Merge pull request #3527 from rishwanth1995/preinstall_script

added setup script to copy the sleuthkit-jar to autopsy folder
This commit is contained in:
Brian Carrier 2018-03-12 16:52:21 -04:00 committed by GitHub
commit b36912acd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 66 additions and 7 deletions

View File

@ -6,7 +6,8 @@
<description>Builds, tests, and runs the project org.sleuthkit.autopsy.core</description> <description>Builds, tests, and runs the project org.sleuthkit.autopsy.core</description>
<import file="nbproject/build-impl.xml"/> <import file="nbproject/build-impl.xml"/>
<import file="../BootstrapIvy.xml"/> <import file="../BootstrapIvy.xml"/>
<import file="../TSKVersion.xml"/>
<property name="thirdparty.dir" value="${basedir}/../thirdparty" /> <property name="thirdparty.dir" value="${basedir}/../thirdparty" />
<property name="modules.dir" value="${basedir}/release/modules/" /> <property name="modules.dir" value="${basedir}/release/modules/" />
@ -17,9 +18,7 @@
<fileset dir="{basedir}/../../InternalPythonModules"/> <fileset dir="{basedir}/../../InternalPythonModules"/>
</copy> </copy>
</target> </target>
<property name="VERSION" value="4.6.0"/>
<target name="get-thirdparty-dependencies" description="get third-party dependencies"> <target name="get-thirdparty-dependencies" description="get third-party dependencies">
<!--Copy openCV dependencies to release--> <!--Copy openCV dependencies to release-->
<copy todir="${modules.dir}" > <copy todir="${modules.dir}" >
@ -54,8 +53,8 @@
<target name="getTSKJars" depends="findTSK"> <target name="getTSKJars" depends="findTSK">
<property environment="env"/> <property environment="env"/>
<copy file="${env.TSK_HOME}/bindings/java/dist/sleuthkit-postgresql-${VERSION}.jar" <copy file="${env.TSK_HOME}/bindings/java/dist/sleuthkit-postgresql-${TSK_VERSION}.jar"
tofile="${ext.dir}/sleuthkit-postgresql-${VERSION}.jar"/> tofile="${ext.dir}/sleuthkit-postgresql-${TSK_VERSION}.jar"/>
<copy file="${env.TSK_HOME}/bindings/java/lib/sqlite-jdbc-3.8.11.jar" <copy file="${env.TSK_HOME}/bindings/java/lib/sqlite-jdbc-3.8.11.jar"
tofile="${ext.dir}/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" <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> <description>Builds the module suite Autopsy 4.</description>
<import file="nbproject/build-impl.xml"/> <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) --> <!-- 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="netbeans-plat-version" value="8.2" />
<property name="nbplatform.active.dir" value="${basedir}/netbeans-plat/${netbeans-plat-version}" /> <property name="nbplatform.active.dir" value="${basedir}/netbeans-plat/${netbeans-plat-version}" />
@ -87,6 +87,13 @@
<copy file="${basedir}/LICENSE-2.0.txt" tofile="${zip-tmp}/${app.name}/LICENSE-2.0.txt"/> <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}/NEWS.txt" tofile="${zip-tmp}/${app.name}/NEWS.txt"/>
<copy file="${basedir}/KNOWN_ISSUES.txt" tofile="${zip-tmp}/${app.name}/KNOWN_ISSUES.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> <if>
<equals arg1="${os.family}" arg2="windows"/> <equals arg1="${os.family}" arg2="windows"/>
<then> <then>

50
unix_setup.sh Executable file
View File

@ -0,0 +1,50 @@
#!/bin/bash
photorec_filepath=/usr/bin/photorec
if [ -f "$photorec_filepath" ]; then
echo "$photorec_filepath found"
else
echo "Photorec not found, please install testdisk for the photorec carver functionality"
echo "run the command: sudo apt-get install testdisk"
exit 1
fi
if [ -n "$JAVA_HOME" ]; then
if [ -x "$JAVA_HOME/bin/java" ]; then
echo "found java executable in $JAVA_HOME"
else
echo "no executable found in $JAVA_HOME"
exit 1
fi
else
echo "Set JAVA_HOME env variable"
exit 1
fi
TSK_VERSION=4.6.0
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 $sleuthkit_jar_filepath to the autopsy directory"
echo "deleting $ext_jar_filepath"
rm $ext_jar_filepath;
if [ "$?" -gt 0 ]; then #checking if remove operation failed
echo "exiting .."
exit 1
else
echo "Successfully removed $ext_jar_filepath"
cp $sleuthkit_jar_filepath $ext_jar_filepath
if [ "$?" -eq 0 ]; then # checking copy operation was successful
echo "Successfully copied $sleuthkit_jar_filepath"
else
echo "exiting..."
exit 1
fi
fi
else
echo "$sleuthkit_jar_filepath not found, please install the sleuthkit-java.deb file"
exit 1
fi
echo "Autopsy is now configured. You can execute bin/autopsy to start it"