Merge branch 'preinstall_script' into develop-merge

This commit is contained in:
rishwanth1995 2018-03-19 08:46:09 -04:00
commit 1ce0fe7458
5 changed files with 76 additions and 13 deletions

View File

@ -6,6 +6,7 @@
<description>Builds, tests, and runs the project org.sleuthkit.autopsy.core</description>
<import file="nbproject/build-impl.xml"/>
<import file="../BootstrapIvy.xml"/>
<import file="../TSKVersion.xml"/>
<property name="thirdparty.dir" value="${basedir}/../thirdparty" />
@ -18,8 +19,6 @@
</copy>
</target>
<property name="VERSION" value="4.6.0"/>
<target name="get-thirdparty-dependencies" description="get third-party dependencies">
<!--Copy openCV dependencies to release-->
<copy todir="${modules.dir}" >
@ -57,8 +56,8 @@
<target name="getTSKJars" depends="findTSK">
<property environment="env"/>
<copy file="${env.TSK_HOME}/bindings/java/dist/sleuthkit-postgresql-${VERSION}.jar"
tofile="${ext.dir}/sleuthkit-postgresql-${VERSION}.jar"/>
<copy file="${env.TSK_HOME}/bindings/java/dist/sleuthkit-postgresql-${TSK_VERSION}.jar"
tofile="${ext.dir}/sleuthkit-postgresql-${TSK_VERSION}.jar"/>
<copy file="${env.TSK_HOME}/bindings/java/lib/sqlite-jdbc-3.8.11.jar"
tofile="${ext.dir}/sqlite-jdbc-3.8.11.jar"/>
<copy file="${env.TSK_HOME}/bindings/java/lib/postgresql-9.4.1211.jre7.jar"

3
TSKVersion.xml Normal file
View File

@ -0,0 +1,3 @@
<project name="TSK_VERSION">
<property name="TSK_VERSION" value="4.6.0"/>
</project>

View File

@ -6,7 +6,7 @@
<description>Builds the module suite Autopsy 4.</description>
<import file="nbproject/build-impl.xml"/>
<import file="${basedir}/TSKVersion.xml"/>
<!-- IMPORTANT: nbproject/platform.properties has a netbeans-plat-version property that MUST be kept in sync (manually) -->
<property name="netbeans-plat-version" value="8.2" />
<property name="nbplatform.active.dir" value="${basedir}/netbeans-plat/${netbeans-plat-version}" />
@ -80,6 +80,10 @@
<mkdir dir="${zip-tmp}"/>
<unzip src="${nbdist.dir}/${app.name}.zip" dest="${zip-tmp}"/>
<!-- Disable the Experimental module by default for the installed version. Need to update .lastModified time for change to be seen. -->
<replace file="${zip-tmp}/autopsy/autopsy/config/Modules/org-sleuthkit-autopsy-experimental.xml" token="&lt;param name=&quot;enabled&quot;&gt;true&lt;/param&gt;" value="&lt;param name=&quot;enabled&quot;&gt;false&lt;/param&gt;"/>
<echo file="${zip-tmp}/autopsy/autopsy/.lastModified" message="" />
<!-- step (3) do your copying stuff here, check the ant doc for copy, move, etc file -->
<copy file="${nbplatform.active.dir}/platform/modules/ext/junit-4.10.jar"
tofile="${zip-tmp}/${app.name}/platform/modules/ext/junit-4.10.jar"/>
@ -87,6 +91,13 @@
<copy file="${basedir}/LICENSE-2.0.txt" tofile="${zip-tmp}/${app.name}/LICENSE-2.0.txt"/>
<copy file="${basedir}/NEWS.txt" tofile="${zip-tmp}/${app.name}/NEWS.txt"/>
<copy file="${basedir}/KNOWN_ISSUES.txt" tofile="${zip-tmp}/${app.name}/KNOWN_ISSUES.txt"/>
<if>
<equals arg1="${os.family}" arg2="unix"/>
<then>
<copy file="${basedir}/unix_setup.sh" tofile="${zip-tmp}/${app.name}/unix_setup.sh"/>
<replaceregexp file="${zip-tmp}/${app.name}/unix_setup.sh" match="TSK_VERSION=(.*)" replace="TSK_VERSION=${TSK_VERSION}" byline="true"/>
</then>
</if>
<if>
<equals arg1="${os.family}" arg2="windows"/>
<then>
@ -287,10 +298,6 @@
<delete dir="${nbdist.dir}/${app.name}-installer" quiet="true"/>
<unzip src="${nbdist.dir}/${app.name}-${app.version}.zip" dest="${nbdist.dir}/${app.name}-installer"/>
<!-- Disable the Experimental module by default for the installed version. Need to update .lastModified time for change to be seen. -->
<replace file="${nbdist.dir}/${app.name}-installer/autopsy/config/modules/org-sleuthkit-autopsy-experimental.xml" token="&lt;param name=&quot;enabled&quot;&gt;true&lt;/param&gt;" value="&lt;param name=&quot;enabled&quot;&gt;false&lt;/param&gt;"/>
<echo file="${nbdist.dir}/${app.name}-installer/autopsy/.lastModified" message="" />
<antcall target="build-installer-${os.family}" />
</target>
</project>

View File

@ -6,8 +6,8 @@ app.name=${branding.token}
### if left unset, version will default to today's date
app.version=4.6.0
### build.type must be one of: DEVELOPMENT, RELEASE
#build.type=RELEASE
build.type=DEVELOPMENT
build.type=RELEASE
#build.type=DEVELOPMENT
project.org.netbeans.progress=org-netbeans-api-progress
project.org.sleuthkit.autopsy.experimental=Experimental

54
unix_setup.sh Executable file
View File

@ -0,0 +1,54 @@
#!/bin/bash
# Verifies programs are installed and copies native code into the Autopsy folder structure
TSK_VERSION=4.6.0
# Verify PhotoRec was installed
photorec_filepath=/usr/bin/photorec
if [ -f "$photorec_filepath" ]; then
echo "$photorec_filepath found"
else
echo "ERROR: Photorec not found, please install the testdisk package"
exit 1
fi
# Verify Java was installed and configured
if [ -n "$JAVA_HOME" ]; then
if [ -x "$JAVA_HOME/bin/java" ]; then
echo "Java found in $JAVA_HOME"
else
echo "ERROR: Java was not found in $JAVA_HOME"
exit 1
fi
else
echo "ERROR: JAVA_HOME environment variable must be defined"
exit 1
fi
# Verify Sleuth Kit Java was installed
sleuthkit_jar_filepath=/usr/share/java/sleuthkit-$TSK_VERSION.jar;
ext_jar_filepath=$PWD/autopsy/modules/ext/sleuthkit-postgresql-$TSK_VERSION.jar;
if [ -f "$sleuthkit_jar_filepath" ]; then
echo "$sleuthkit_jar_filepath found"
echo "Copying into the Autopsy directory"
rm $ext_jar_filepath;
if [ "$?" -gt 0 ]; then #checking if remove operation failed
echo "exiting .."
exit 1
else
cp $sleuthkit_jar_filepath $ext_jar_filepath
if [ "$?" -ne 0 ]; then # checking copy operation was successful
echo "exiting..."
exit 1
fi
fi
else
echo "ERROR: $sleuthkit_jar_filepath not found, please install the sleuthkit-java.deb file"
exit 1
fi
# make sure it is executable
chmod +x bin/autopsy
echo "Autopsy is now configured. You can execute bin/autopsy to start it"