From 8fcbc2b3a06b89f308f53a625a932c269d37bf4e Mon Sep 17 00:00:00 2001 From: Jan-Pascal van Best Date: Sun, 22 Apr 2012 15:05:55 +0200 Subject: [PATCH] Create windows installer using nsis --- release.sh | 2 ++ tv_grab_nl_java.nsi | 87 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 tv_grab_nl_java.nsi diff --git a/release.sh b/release.sh index 47e185a..8de82f9 100755 --- a/release.sh +++ b/release.sh @@ -25,4 +25,6 @@ pushd "$tmpdir" zip -r "$ZIPFILE" * popd +makensis -DVERSION=$VERSION tv_grab_nl_java.nsi + rm -rf $tmpdir diff --git a/tv_grab_nl_java.nsi b/tv_grab_nl_java.nsi new file mode 100644 index 0000000..1a00762 --- /dev/null +++ b/tv_grab_nl_java.nsi @@ -0,0 +1,87 @@ +; Name of our application +Name "tv_grab_nl_java" + +; The file to write +OutFile "../Setup-tv_grab_nl_java-${VERSION}.exe" + +; Set the default Installation Directory +InstallDir "$PROGRAMFILES\tv_grab_nl_java" + +; Set the text which prompts the user to enter the installation directory +DirText "Please choose a directory to which you'd like to install this application." + +; ---------------------------------------------------------------------------------- +; *************************** SECTION FOR INSTALLING ******************************* +; ---------------------------------------------------------------------------------- + +Section "" ; A "useful" name is not needed as we are not installing separate components + +; Set output path to the installation directory. Also sets the working +; directory for shortcuts +SetOutPath $INSTDIR\ + +File /oname=tv_grab_nl_java.jar target/tv_grab_nl_java-${VERSION}-dep.jar +File /oname=readme.txt README +File /oname=changelog.txt Changelog +File /oname=license.txt LICENSE +; File createInstaller1.nsi + +WriteUninstaller $INSTDIR\Uninstall.exe + +; ///////////////// CREATE SHORT CUTS ////////////////////////////////////// + +CreateDirectory "$SMPROGRAMS\tv_grab_nl_java" + + +CreateShortCut "$SMPROGRAMS\tv_grab_nl_java\Configure tv_grab_nl_java.lnk" \ + "$SYSDIR\java.exe" \ + '-classpath "$INSTDIR\tv_grab_nl_java.jar" org.vanbest.xmltv.Main --configure' +CreateShortCut "$SMPROGRAMS\tv_grab_nl_java\Run tv_grab_nl_java.lnk" \ + "$SYSDIR\java.exe" \ + '-classpath "$INSTDIR\tv_grab_nl_java.jar" org.vanbest.xmltv.Main' + + +CreateShortCut "$SMPROGRAMS\tv_grab_nl_java\Uninstall tv_grab_nl_java.lnk" "$INSTDIR\Uninstall.exe" + +; ///////////////// END CREATING SHORTCUTS ////////////////////////////////// + +; //////// CREATE REGISTRY KEYS FOR ADD/REMOVE PROGRAMS IN CONTROL PANEL ///////// + +WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\tv_grab_nl_java" "DisplayName"\ +"tv_grab_nl_java (remove only)" + +WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\tv_grab_nl_java" "UninstallString" \ +"$INSTDIR\Uninstall.exe" + +; //////////////////////// END CREATING REGISTRY KEYS //////////////////////////// + +MessageBox MB_OK "Installation was successful." + +SectionEnd + +; ---------------------------------------------------------------------------------- +; ************************** SECTION FOR UNINSTALLING ****************************** +; ---------------------------------------------------------------------------------- + +Section "Uninstall" +; remove all the files and folders +Delete $INSTDIR\Uninstall.exe ; delete self +Delete $INSTDIR\tv_grab_nl_java.jar +Delete $INSTDIR\readme.txt +Delete $INSTDIR\license.txt +Delete $INSTDIR\changelog.txt +;Delete $INSTDIR\createInstaller1.nsi + +RMDir $INSTDIR + +; now remove all the startmenu links +Delete "$SMPROGRAMS\tv_grab_nl_java\Run tv_grab_nl_java.lnk" +Delete "$SMPROGRAMS\tv_grab_nl_java\Uninstall tv_grab_nl_java.lnk" +RMDIR "$SMPROGRAMS\tv_grab_nl_java" + +; Now delete registry keys +DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\tv_grab_nl_java" +DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\tv_grab_nl_java" + +SectionEnd + -- 2.39.5