Updated NSIS installer
Added: - game icon - left side image - desktop shortcut - main menu shortcut - working directory in AppData
This commit is contained in:
		
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -30,6 +30,8 @@ build_packages/*
 | 
				
			|||||||
!build_packages/NSIS
 | 
					!build_packages/NSIS
 | 
				
			||||||
build_packages/NSIS/*
 | 
					build_packages/NSIS/*
 | 
				
			||||||
!build_packages/NSIS/ProgressiaInstaller.nsi
 | 
					!build_packages/NSIS/ProgressiaInstaller.nsi
 | 
				
			||||||
 | 
					!build_packages/NSIS/logo.ico
 | 
				
			||||||
 | 
					!build_packages/NSIS/left_side.bmp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# ... and except build_packages/DEB/template
 | 
					# ... and except build_packages/DEB/template
 | 
				
			||||||
!build_packages/DEB
 | 
					!build_packages/DEB
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -128,6 +128,7 @@ buildWindowsInstaller() {
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
        cp -r 'build/libs/lib'            'build_packages/NSIS/lib'            &&
 | 
					        cp -r 'build/libs/lib'            'build_packages/NSIS/lib'            &&
 | 
				
			||||||
        cp    'build/libs/Progressia.jar' 'build_packages/NSIS/Progressia.jar' &&
 | 
					        cp    'build/libs/Progressia.jar' 'build_packages/NSIS/Progressia.jar' &&
 | 
				
			||||||
 | 
					        cp    'LICENSE'                   'build_packages/NSIS/LICENSE.txt'    &&
 | 
				
			||||||
        echo "------ NSIS ------"                                              &&
 | 
					        echo "------ NSIS ------"                                              &&
 | 
				
			||||||
        makensis "$configurationFile"                                          &&
 | 
					        makensis "$configurationFile"                                          &&
 | 
				
			||||||
        echo "---- NSIS END ----"                                              &&
 | 
					        echo "---- NSIS END ----"                                              &&
 | 
				
			||||||
@@ -144,6 +145,9 @@ buildWindowsInstaller() {
 | 
				
			|||||||
        if [ -e 'build_packages/NSIS/Progressia.jar' ]; then
 | 
					        if [ -e 'build_packages/NSIS/Progressia.jar' ]; then
 | 
				
			||||||
            rm 'build_packages/NSIS/Progressia.jar'
 | 
					            rm 'build_packages/NSIS/Progressia.jar'
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
 | 
					        if [ -e 'build_packages/NSIS/LICENSE.txt' ]; then
 | 
				
			||||||
 | 
					            rm 'build_packages/NSIS/LICENSE.txt'
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
        echo "Cleaned up"
 | 
					        echo "Cleaned up"
 | 
				
			||||||
    } || {
 | 
					    } || {
 | 
				
			||||||
        echoerr "Could not clean up after building Windows installer"
 | 
					        echoerr "Could not clean up after building Windows installer"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,16 +10,32 @@
 | 
				
			|||||||
;--------------------------------
 | 
					;--------------------------------
 | 
				
			||||||
;General
 | 
					;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 and file
 | 
				
			||||||
  Name "Progressia"
 | 
					  Name "${PROJECT_NAME}"
 | 
				
			||||||
  OutFile "ProgressiaInstaller.exe"
 | 
					  OutFile "${PROJECT_NAME}Installer.exe"
 | 
				
			||||||
  Unicode True
 | 
					  Unicode True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ;Default installation folder
 | 
					  ;Default installation folder
 | 
				
			||||||
  InstallDir "$PROGRAMFILES\Progressia"
 | 
					  InstallDir "$PROGRAMFILES\${PROJECT_NAME}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ;Get installation folder from registry if available
 | 
					  ;Get installation folder from registry if available
 | 
				
			||||||
  InstallDirRegKey HKLM "Software\Progressia" "Install_Dir"
 | 
					  InstallDirRegKey HKLM "Software\${PROJECT_NAME}" ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ;Request application privileges for Windows Vista
 | 
					  ;Request application privileges for Windows Vista
 | 
				
			||||||
  RequestExecutionLevel admin
 | 
					  RequestExecutionLevel admin
 | 
				
			||||||
@@ -33,14 +49,18 @@
 | 
				
			|||||||
;Pages
 | 
					;Pages
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  !insertmacro MUI_PAGE_WELCOME
 | 
					  !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_COMPONENTS
 | 
				
			||||||
  !insertmacro MUI_PAGE_DIRECTORY
 | 
					  !insertmacro MUI_PAGE_DIRECTORY
 | 
				
			||||||
  !insertmacro MUI_PAGE_INSTFILES
 | 
					  !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_PAGE_FINISH
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  !insertmacro MUI_UNPAGE_WELCOME
 | 
					  !insertmacro MUI_UNPAGE_WELCOME
 | 
				
			||||||
  !insertmacro MUI_UNPAGE_CONFIRM
 | 
					  !insertmacro MUI_UNPAGE_CONFIRM
 | 
				
			||||||
 | 
					  !insertmacro MUI_UNPAGE_COMPONENTS
 | 
				
			||||||
  !insertmacro MUI_UNPAGE_INSTFILES
 | 
					  !insertmacro MUI_UNPAGE_INSTFILES
 | 
				
			||||||
  !insertmacro MUI_UNPAGE_FINISH
 | 
					  !insertmacro MUI_UNPAGE_FINISH
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -52,12 +72,15 @@
 | 
				
			|||||||
;--------------------------------
 | 
					;--------------------------------
 | 
				
			||||||
;Installer Sections
 | 
					;Installer Sections
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Section "Install Progressia" SecDummy
 | 
					Section "Install ${PROJECT_NAME}" SEC0000
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  SectionIn RO ;Make it read-only
 | 
				
			||||||
  SetOutPath "$INSTDIR"
 | 
					  SetOutPath "$INSTDIR"
 | 
				
			||||||
 | 
					  SetOverwrite on
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ;Files
 | 
					  ;Files
 | 
				
			||||||
  File Progressia.jar
 | 
					  File Progressia.jar
 | 
				
			||||||
 | 
					  File logo.ico
 | 
				
			||||||
  File /r lib
 | 
					  File /r lib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ;Store installation folder
 | 
					  ;Store installation folder
 | 
				
			||||||
@@ -65,22 +88,24 @@ Section "Install Progressia" SecDummy
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  ;Create uninstaller
 | 
					  ;Create uninstaller
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Progressia" "DisplayName" "Progressia (remove only)"
 | 
					  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROJECT_NAME}" "DisplayName" "${PROJECT_NAME} (remove only)"
 | 
				
			||||||
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Progressia" "UninstallString" "$INSTDIR\Uninstall.exe" 
 | 
					  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROJECT_NAME}" "UninstallString" "$INSTDIR\Uninstall.exe"
 | 
				
			||||||
  WriteUninstaller "$INSTDIR\Uninstall.exe"
 | 
					  WriteUninstaller "$INSTDIR\Uninstall.exe"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SectionEnd
 | 
					SectionEnd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;--------------------------------
 | 
					Section "Create Desktop Shortcut" SEC0001
 | 
				
			||||||
;Descriptions
 | 
					  SetOutPath "$APPDATA\${PROJECT_NAME}"
 | 
				
			||||||
 | 
					  CreateShortCut "$DESKTOP\${PROJECT_NAME}.lnk" "$INSTDIR\${PROJECT_NAME}.jar" "" "$INSTDIR\logo.ico"
 | 
				
			||||||
 | 
					SectionEnd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ;Language strings
 | 
					Section "Start Menu Shortcuts" SEC0002
 | 
				
			||||||
  LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ;Assign language strings to sections
 | 
					  CreateDirectory "$SMPROGRAMS\${PROJECT_NAME}"
 | 
				
			||||||
  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
 | 
					  CreateShortcut "$SMPROGRAMS\${PROJECT_NAME}\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
 | 
				
			||||||
    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
 | 
					  CreateShortcut "$SMPROGRAMS\${PROJECT_NAME}\${PROJECT_NAME}.lnk" "$INSTDIR\${PROJECT_NAME}.jar" "" "$INSTDIR\logo.ico"
 | 
				
			||||||
  !insertmacro MUI_FUNCTION_DESCRIPTION_END
 | 
					
 | 
				
			||||||
 | 
					SectionEnd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;--------------------------------
 | 
					;--------------------------------
 | 
				
			||||||
;Uninstaller Section
 | 
					;Uninstaller Section
 | 
				
			||||||
@@ -92,9 +117,45 @@ Section "Uninstall"
 | 
				
			|||||||
  Delete $INSTDIR\Uninstall.exe
 | 
					  Delete $INSTDIR\Uninstall.exe
 | 
				
			||||||
  Delete $INSTDIR\Progressia.jar
 | 
					  Delete $INSTDIR\Progressia.jar
 | 
				
			||||||
  Delete $INSTDIR\lib\*.*
 | 
					  Delete $INSTDIR\lib\*.*
 | 
				
			||||||
 | 
					  Delete $INSTDIR\logo.ico
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  RMDir /r "$INSTDIR"
 | 
					  RMDir $INSTDIR\lib
 | 
				
			||||||
  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Progressia"
 | 
					
 | 
				
			||||||
  DeleteRegKey HKLM "Software\Progressia"
 | 
					  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
 | 
					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
 | 
				
			||||||
							
								
								
									
										
											BIN
										
									
								
								build_packages/NSIS/left_side.bmp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								build_packages/NSIS/left_side.bmp
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 151 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								build_packages/NSIS/logo.ico
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								build_packages/NSIS/logo.ico
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 187 KiB  | 
		Reference in New Issue
	
	Block a user