Add version information to NSIS installer script.

TODO: check for installed Bochs version and ofter suitable options.
This commit is contained in:
Volker Ruppert 2019-11-26 20:21:56 +00:00
parent cf23a59a55
commit cb1c03efec

View File

@ -56,7 +56,7 @@ Var IndependentSectionState
;Folder-select dialog
InstallDir $PROGRAMFILES\Bochs-${VERSION}
InstallDirRegKey HKLM "Software\${NAME}" ""
InstallDirRegKey HKLM "Software\Bochs" ""
;--------------------------------
;Interface Settings
@ -66,6 +66,14 @@ Var IndependentSectionState
!define MUI_ICON "bochs.ico"
!define MUI_UNICON "unbochs.ico"
;--------------------------------
;Version information
VIProductVersion ${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}.${VER_SVN}
VIAddVersionKey "FileVersion" "${VERSION}"
VIAddVersionKey "FileDescription" "Bochs Setup"
VIAddVersionKey "LegalCopyright" "Copyright 2001-2019 The Bochs Project"
;--------------------------------
;Pages
!define MUI_WELCOMEFINISHPAGE_BITMAP "bochs-logo.bmp"
@ -242,17 +250,21 @@ SectionEnd
Section -post
; Register Uninstaller
WriteRegStr HKLM "SOFTWARE\${NAME}" "" $INSTDIR
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "DisplayName" "${NAME} (remove only)"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "DisplayIcon" "$INSTDIR\bochs.ico,0"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "DisplayVersion" "${VERSION}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "Publisher" "The Bochs Project"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "URLInfoAbout" "http://bochs.sourceforge.net"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "Readme" '$INSTDIR\Readme.txt'
WriteRegDWord HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "NoModify" "1"
WriteRegDWord HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "NoRepair" "1"
WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "InstallLocation" '$INSTDIR\'
WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "UninstallString" '"$INSTDIR\Uninstall.exe"'
WriteRegStr HKLM "Sostware\Bochs" "" $INSTDIR
WriteRegDword HKLM "Software\Bochs" "VersionMajor" "${VER_MAJOR}"
WriteRegDword HKLM "Software\Bochs" "VersionMinor" "${VER_MINOR}"
WriteRegDword HKLM "Software\Bochs" "VersionPatch" "${VER_PATCH}"
WriteRegDword HKLM "Software\Bochs" "VersionSVN" "${VER_SVN}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bochs" "DisplayName" "${NAME} (remove only)"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bochs" "DisplayIcon" "$INSTDIR\bochs.ico,0"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bochs" "DisplayVersion" "${VERSION}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bochs" "Publisher" "The Bochs Project"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bochs" "URLInfoAbout" "http://bochs.sourceforge.net"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bochs" "Readme" '$INSTDIR\Readme.txt'
WriteRegDWord HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bochs" "NoModify" "1"
WriteRegDWord HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bochs" "NoRepair" "1"
WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bochs" "InstallLocation" '$INSTDIR\'
WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bochs" "UninstallString" '"$INSTDIR\Uninstall.exe"'
; Write the uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
@ -276,8 +288,8 @@ Section "Uninstall"
NoOwn:
DeleteRegKey HKCR "BochsConfigFile"
DeleteRegKey HKLM "SOFTWARE\${NAME}"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}"
DeleteRegKey HKLM "SOFTWARE\Bochs"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bochs"
Delete "${PGDIR}\*.lnk"
Delete "${PGDIR}\*.url"