Commit 8f8dfb89 authored by Gregor Pintar's avatar Gregor Pintar

Windows setup improved (license text, ask to run, ...), Windows launcher supports jre bundling.

parent aecf1fb5
......@@ -16,11 +16,10 @@ OutFile "SpeakerSimSetup.exe"
VIAddVersionKey "ProductName" "SpeakerSim"
VIAddVersionKey "FileDescription" "SpeakerSim"
VIAddVersionKey "LegalCopyright" ""
VIAddVersionKey "FileVersion" "1.0.0"
VIProductVersion "1.0.0.0"
VIAddVersionKey "FileVersion" "0.0.0.0"
VIProductVersion "0.0.0.0"
!define PRODUCT_NAME "SpeakerSim"
!define INSTALLSIZE 3000
RequestExecutionLevel user
AutoCloseWindow true
......@@ -30,42 +29,40 @@ SetCompressor /SOLID zlib
!include "MUI2.nsh"
;!define MUI_ABORTWARNING
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE COPYING
!insertmacro MUI_PAGE_INSTFILES
;!insertmacro MUI_UNPAGE_CONFIRM
!define MUI_FINISHPAGE_SHOWREADME ""
!define MUI_FINISHPAGE_SHOWREADME_CHECKED
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Create Desktop shortcut"
!define MUI_FINISHPAGE_SHOWREADME_FUNCTION finish_page_action
!define MUI_FINISHPAGE_RUN "$INSTDIR\SpeakerSim.exe"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
Section
SetOutPath $INSTDIR
SetOutPath "$INSTDIR"
File "SpeakerSim.jar"
File "SpeakerSim.exe"
File /nonfatal /r "jre"
WriteUninstaller "$INSTDIR\uninstall.exe"
; Shortcuts
; Menu shortcut
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}.lnk" "$INSTDIR\SpeakerSim.exe" "" "$INSTDIR\SpeakerSim.exe"
CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\SpeakerSim.exe" "" "$INSTDIR\SpeakerSim.exe"
; Registry information for add/remove programs
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayName" "${PRODUCT_NAME}"
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
;WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "InstallLocation" "$\"$INSTDIR$\""
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayIcon" "$\"$INSTDIR\SpeakerSim.exe$\""
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "Publisher" "Gregor Pintar"
;WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "HelpLink" "$\"${HELPURL}$\""
;WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "URLUpdateInfo" "$\"${UPDATEURL}$\""
;WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "URLInfoAbout" "$\"${ABOUTURL}$\""
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayVersion" "1.0.0"
WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "VersionMajor" 1
WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "VersionMinor" 0
WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "NoModify" 1
WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "NoRepair" 1
WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "EstimatedSize" ${INSTALLSIZE}
; Register file association
WriteRegStr HKCU "Software\Classes\.ssim" "" "${PRODUCT_NAME}"
......@@ -75,25 +72,31 @@ Section
WriteRegStr HKCU "Software\Classes\${PRODUCT_NAME}\shell\open\command" "" '"$INSTDIR\SpeakerSim.exe" "%1"'
WriteRegStr HKCU "Software\Classes\${PRODUCT_NAME}\shell\edit" "" "Open in ${PRODUCT_NAME}"
WriteRegStr HKCU "Software\Classes\${PRODUCT_NAME}\shell\edit\command" "" '"$INSTDIR\SpeakerSim.exe" "%1"'
Exec "$INSTDIR\SpeakerSim.exe"
SectionEnd
Function finish_page_action
; Desktop shortcut
CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\SpeakerSim.exe" "" "$INSTDIR\SpeakerSim.exe"
FunctionEnd
Section "Uninstall"
SetOutPath "$TEMP"
; Remove shortcuts
Delete "$SMPROGRAMS\${PRODUCT_NAME}.lnk"
Delete "$DESKTOP\${PRODUCT_NAME}.lnk"
Delete /REBOOTOK "$SMPROGRAMS\${PRODUCT_NAME}.lnk"
Delete /REBOOTOK "$DESKTOP\${PRODUCT_NAME}.lnk"
; Delete files
Delete /REBOOTOK "$INSTDIR\SpeakerSim.jar"
Delete /REBOOTOK "$INSTDIR\SpeakerSim.exe"
RMDir /r /REBOOTOK "$INSTDIR\jre"
Delete /REBOOTOK "$INSTDIR\uninstall.exe"
RMDir /REBOOTOK "$INSTDIR"
; Unregister file association
DeleteRegKey HKCU "Software\Classes\${PRODUCT_NAME}"
DeleteRegKey HKCU "Software\Classes\.ssim"
; Delete files
Delete $INSTDIR\SpeakerSim.jar
Delete $INSTDIR\SpeakerSim.exe
Delete $INSTDIR\uninstall.exe
RmDir $INSTDIR
; Remove uninstaller information from the registry
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
SectionEnd
......@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>SpeakerSim</groupId>
<artifactId>SpeakerSim</artifactId>
<version>2019-04-07</version>
<version>2019-04-09</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
......@@ -75,7 +75,8 @@
</goals>
<configuration>
<headerType>gui</headerType>
<jar>target/SpeakerSim-jar-with-dependencies.jar</jar>
<jar>SpeakerSim.jar</jar>
<dontWrapJar>true</dontWrapJar>
<outfile>SpeakerSim.exe</outfile>
<downloadUrl>http://java.com/download</downloadUrl>
<classPath>
......@@ -83,18 +84,19 @@
</classPath>
<icon>SpeakerSim.ico</icon>
<jre>
<bundledJre64Bit>false</bundledJre64Bit>
<bundledJreAsFallback>false</bundledJreAsFallback>
<minVersion>1.7.0</minVersion>
<jdkPreference>preferJre</jdkPreference>
<path>jre</path>
<bundledJreAsFallback>true</bundledJreAsFallback>
<bundledJre64Bit>false</bundledJre64Bit>
</jre>
<versionInfo>
<fileVersion>1.0.0.0</fileVersion>
<fileVersion>0.0.0.0</fileVersion>
<productVersion>0.0.0.0</productVersion>
<txtProductVersion>${project.version}</txtProductVersion>
<txtFileVersion>${project.version}</txtFileVersion>
<fileDescription>${project.name}</fileDescription>
<copyright>Copyright 2019 Gregor Pintar</copyright>
<productVersion>1.0.0.0</productVersion>
<txtProductVersion>1.0.0.0</txtProductVersion>
<productName>${project.name}</productName>
<internalName>SpeakerSim</internalName>
<originalFilename>SpeakerSim.exe</originalFilename>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment