diff --git a/.gitignore b/.gitignore index fe88422..54b9b19 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,8 @@ build_packages/* !build_packages/NSIS build_packages/NSIS/* !build_packages/NSIS/ProgressiaInstaller.nsi +!build_packages/NSIS/logo.ico +!build_packages/NSIS/left_side.bmp # ... and except build_packages/DEB/template !build_packages/DEB diff --git a/buildPackages.sh b/buildPackages.sh index d1d4f5a..a415b1f 100755 --- a/buildPackages.sh +++ b/buildPackages.sh @@ -128,6 +128,7 @@ buildWindowsInstaller() { { cp -r 'build/libs/lib' 'build_packages/NSIS/lib' && cp 'build/libs/Progressia.jar' 'build_packages/NSIS/Progressia.jar' && + cp 'LICENSE' 'build_packages/NSIS/LICENSE.txt' && echo "------ NSIS ------" && makensis "$configurationFile" && echo "---- NSIS END ----" && @@ -144,6 +145,9 @@ buildWindowsInstaller() { if [ -e 'build_packages/NSIS/Progressia.jar' ]; then rm 'build_packages/NSIS/Progressia.jar' fi + if [ -e 'build_packages/NSIS/LICENSE.txt' ]; then + rm 'build_packages/NSIS/LICENSE.txt' + fi echo "Cleaned up" } || { echoerr "Could not clean up after building Windows installer" diff --git a/build_packages/NSIS/ProgressiaInstaller.nsi b/build_packages/NSIS/ProgressiaInstaller.nsi index 63dd4ff..abf8d73 100644 --- a/build_packages/NSIS/ProgressiaInstaller.nsi +++ b/build_packages/NSIS/ProgressiaInstaller.nsi @@ -10,16 +10,32 @@ ;-------------------------------- ;General + !define PROJECT_NAME "Progressia" + + ; MUI Settings / Icons + !define MUI_ICON "logo.ico" + ;!define MUI_UNICON ;Uninstall icon + + ; MUI Settings / Header + ; !define MUI_HEADERIMAGE + ; !define MUI_HEADERIMAGE_RIGHT + ; !define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\orange-r-nsis.bmp" + ; !define MUI_HEADERIMAGE_UNBITMAP "${NSISDIR}\Contrib\Graphics\Header\orange-uninstall-r-nsis.bmp" + + ; MUI Settings / Wizard + !define MUI_WELCOMEFINISHPAGE_BITMAP "left_side.bmp" + !define MUI_UNWELCOMEFINISHPAGE_BITMAP "left_side.bmp" + ;Name and file - Name "Progressia" - OutFile "ProgressiaInstaller.exe" + Name "${PROJECT_NAME}" + OutFile "${PROJECT_NAME}Installer.exe" Unicode True ;Default installation folder - InstallDir "$PROGRAMFILES\Progressia" + InstallDir "$PROGRAMFILES\${PROJECT_NAME}" ;Get installation folder from registry if available - InstallDirRegKey HKLM "Software\Progressia" "Install_Dir" + InstallDirRegKey HKLM "Software\${PROJECT_NAME}" "" ;Request application privileges for Windows Vista RequestExecutionLevel admin @@ -33,14 +49,18 @@ ;Pages !insertmacro MUI_PAGE_WELCOME - ;!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt" + !insertmacro MUI_PAGE_LICENSE "LICENSE.txt" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES + !define MUI_FINISHPAGE_RUN + !define MUI_FINISHPAGE_RUN_TEXT "Start ${PROJECT_NAME}" + !define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink" !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_WELCOME !insertmacro MUI_UNPAGE_CONFIRM + !insertmacro MUI_UNPAGE_COMPONENTS !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_FINISH @@ -52,35 +72,40 @@ ;-------------------------------- ;Installer Sections -Section "Install Progressia" SecDummy +Section "Install ${PROJECT_NAME}" SEC0000 + SectionIn RO ;Make it read-only SetOutPath "$INSTDIR" + SetOverwrite on ;Files File Progressia.jar + File logo.ico File /r lib ;Store installation folder WriteRegStr HKLM SOFTWARE\Progressia "Install_Dir" "$INSTDIR" ;Create uninstaller - - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Progressia" "DisplayName" "Progressia (remove only)" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Progressia" "UninstallString" "$INSTDIR\Uninstall.exe" + + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROJECT_NAME}" "DisplayName" "${PROJECT_NAME} (remove only)" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROJECT_NAME}" "UninstallString" "$INSTDIR\Uninstall.exe" WriteUninstaller "$INSTDIR\Uninstall.exe" - + SectionEnd -;-------------------------------- -;Descriptions +Section "Create Desktop Shortcut" SEC0001 + SetOutPath "$APPDATA\${PROJECT_NAME}" + CreateShortCut "$DESKTOP\${PROJECT_NAME}.lnk" "$INSTDIR\${PROJECT_NAME}.jar" "" "$INSTDIR\logo.ico" +SectionEnd - ;Language strings - LangString DESC_SecDummy ${LANG_ENGLISH} "A test section." +Section "Start Menu Shortcuts" SEC0002 - ;Assign language strings to sections - !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN - !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy) - !insertmacro MUI_FUNCTION_DESCRIPTION_END + CreateDirectory "$SMPROGRAMS\${PROJECT_NAME}" + CreateShortcut "$SMPROGRAMS\${PROJECT_NAME}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" + CreateShortcut "$SMPROGRAMS\${PROJECT_NAME}\${PROJECT_NAME}.lnk" "$INSTDIR\${PROJECT_NAME}.jar" "" "$INSTDIR\logo.ico" + +SectionEnd ;-------------------------------- ;Uninstaller Section @@ -92,9 +117,45 @@ Section "Uninstall" Delete $INSTDIR\Uninstall.exe Delete $INSTDIR\Progressia.jar Delete $INSTDIR\lib\*.* + Delete $INSTDIR\logo.ico - RMDir /r "$INSTDIR" - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Progressia" - DeleteRegKey HKLM "Software\Progressia" + RMDir $INSTDIR\lib + + Delete $DESKTOP\${PROJECT_NAME}.lnk + + Delete $SMPROGRAMS\${PROJECT_NAME}\Uninstall.lnk + Delete $SMPROGRAMS\${PROJECT_NAME}\${PROJECT_NAME}.lnk + + RMDir $INSTDIR + + RMDir /r $SMPROGRAMS\${PROJECT_NAME} + + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROJECT_NAME}" + DeleteRegKey HKLM "Software\${PROJECT_NAME}" SectionEnd + +Section "un.Remove user data" + + RMDir /r "$APPDATA\${PROJECT_NAME}" + +SectionEnd + +;-------------------------------- +;Functions + +Function LaunchLink + SetOutPath "$APPDATA\${PROJECT_NAME}" + ExecShell "" "$INSTDIR\${PROJECT_NAME}.jar" +FunctionEnd + +;-------------------------------- +;Descriptions + + ;Language strings + LangString DESC_SecDummy ${LANG_ENGLISH} "Install ${PROJECT_NAME}." + + ;Assign language strings to sections + !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${SEC0000} $(DESC_SecDummy) + !insertmacro MUI_FUNCTION_DESCRIPTION_END \ No newline at end of file diff --git a/build_packages/NSIS/left_side.bmp b/build_packages/NSIS/left_side.bmp new file mode 100644 index 0000000..1dd523c Binary files /dev/null and b/build_packages/NSIS/left_side.bmp differ diff --git a/build_packages/NSIS/logo.ico b/build_packages/NSIS/logo.ico new file mode 100644 index 0000000..e858a48 Binary files /dev/null and b/build_packages/NSIS/logo.ico differ