Skip to content
Snippets Groups Projects
Commit 7f4c0757 authored by an7s's avatar an7s
Browse files

Create desktop shortcut as part of installation process

Former-commit-id: 31f762d6d99593016e9d3d0d9f060aefb2dcd8dc
parent ebf7665c
Branches
Tags
No related merge requests found
......@@ -52,16 +52,25 @@ cd $USER_DOWNLOAD_DIR/$INSTALLER_DIR
rm -fr *.tar *.tgz *peasoup* *instal* *analysis*
# make install script
cp $PEASOUP_HOME/tools/ps_install.sh $PROG.install.sh
chmod +x $PROG.install.sh
installer_name=${PROG}.installer.sh
cp $PEASOUP_HOME/tools/ps_install.sh ${ANALYSIS_DIR}/${installer_name}
chmod +x ${ANALYSIS_DIR}/${installer_name}
# create self-extracting archive/installer
makeself --notemp ${ANALYSIS_DIR} ${PROG}.installer "Self-extracting installer for ${PROG}" ./${installer_name}
mv ${PROG}.installer ${ANALYSIS_DIR}
# link to analysis dir
ln -s $ANALYSIS_DIR analysis_dir
#ln -s $ANALYSIS_DIR analysis_dir
# create self installing archive
# make the tarball
cd $USER_DOWNLOAD_DIR
tar -hcvf $PROG.tar $INSTALLER_DIR
gzip $PROG.tar
mv $PROG.tar.gz "${ANALYSIS_DIR}/${PROG}.tgz"
#cd $USER_DOWNLOAD_DIR
#tar -hcvf $PROG.tar $INSTALLER_DIR
#gzip $PROG.tar
#mv $PROG.tar.gz "${ANALYSIS_DIR}/${PROG}.zar"
# cleanup
#if [ ! -z $USER_DOWNLOAD_DIR ]; then
......
#!/bin/bash
# Installer name is of the form: program.install.sh
PROG=$(basename $0 .install.sh)
PROG=$(basename $0 .installer.sh)
# Default installation directory
INSTALL_DIR=/tmp/protected/bin
if [ ! -d analysis_dir ]; then
echo "Looks like you've already installed ${PROG}"
echo
echo "Type any key to continue"
read anykey
exit 1
fi
INSTALL_DIR=/tmp/zest_install/bin
DESKTOP_ZEPHYR_DIR=$HOME/Desktop/ZephyrProtected
create_desktop_shortcut()
{
name=$1
pathprotected=$2
if [ -d "$HOME/Desktop" ]; then
if [ ! -d "$DESKTOP_ZEPHYR_DIR" ]; then
mkdir $DESKTOP_ZEPHYR_DIR
fi
desktopfile=${DESKTOP_ZEPHYR_DIR}/${name}.desktop
echo "[Desktop Entry]" > $desktopfile
echo "Name=$name" >> $desktopfile
echo "Comment=Run $name" >> $desktopfile
echo "Exec=${pathprotected}" >> $desktopfile
echo 'Terminal=false' >> $desktopfile
echo 'Type=Application' >> $desktopfile
echo 'Icon=utilities-terminal' >> $desktopfile
chmod +x $desktopfile
return 0
else
return 1
fi
}
echo "Installing protected version of $PROG"
echo ================================================================
echo "Installing $PROG"
echo "Installation directory: $INSTALL_DIR"
echo "Fully qualified path: $INSTALL_DIR/$PROG"
......@@ -25,19 +42,38 @@ read anykey
# in case it's not there yet
mkdir -p $INSTALL_DIR
chmod +x analysis_dir/a.stratafied
chmod +x ./a.stratafied
# wipe out any old installs
if [ -d "$INSTALL_DIR/${PROG}_analysis" ]; then
rm -fr "$INSTALL_DIR/${PROG}_analysis"
fi
#cp -r analysis_dir $INSTALL_DIR/${PROG}_analysis
mv analysis_dir $INSTALL_DIR/${PROG}_analysis
cp -r . $INSTALL_DIR/${PROG}_analysis
#mv analysis_dir $INSTALL_DIR/${PROG}_analysis
echo "$INSTALL_DIR/${PROG}_analysis/ps_run.sh $INSTALL_DIR/${PROG}_analysis \"\$0\" \"\$@\"" > $INSTALL_DIR/$PROG
chmod +x $INSTALL_DIR/$PROG
echo "Create desktop shortcut (yes|no)?"
read answer
case "$answer" in
y|yes)
create_desktop_shortcut ${PROG} ${INSTALL_DIR}/${PROG}
if [ $? -eq 0 ]; then
echo Desktop shortcut succesfully created in $DESKTOP_ZEPHYR_DIR
else
echo Could not create desktop shortcut in $DESKTOP_ZEPHYR_DIR
fi
;;
*)
echo No desktop shortcut created
;;
esac
echo ""
echo "Installation complete"
echo ""
echo ================================================================
echo "Type any key to continue"
read anykey
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment