Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Update for the Windows Installer #2128

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+40 −35
Split
View
@@ -1,11 +1,14 @@
Name Bitcoin
-RequestExecutionLevel highest
+RequestExecutionLevel admin
SetCompressor /SOLID lzma
+!define NAME Bitcoin
+
# General Symbol Definitions
-!define REGKEY "SOFTWARE\$(^Name)"
+!define REGKEY "SOFTWARE\${NAME}"
!define VERSION 0.8.2
+!define PRODUCT_VERSION "${VERSION}.0"
!define COMPANY "Bitcoin project"
@Diapolo

Diapolo Jul 12, 2013

After looking into https://github.com/bitcoin/bitcoin/blob/master/src/qt/res/bitcoin-qt.rc I would vote for harmonizing some strings and replacing this with just Bitcoin as we also use it in bitcoin.cpp as QApplication::setOrganizationName("Bitcoin");.

!define URL http://www.bitcoin.org/
@Diapolo

Diapolo Jul 12, 2013

Can this be just bitcoin.org perhaps, as we are using QApplication::setOrganizationDomain("bitcoin.org"); in bitcoin.cpp?

@@ -19,7 +22,7 @@ SetCompressor /SOLID lzma
!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
-!define MUI_STARTMENUPAGE_DEFAULTFOLDER Bitcoin
+!define MUI_STARTMENUPAGE_DEFAULTFOLDER ${NAME}
!define MUI_FINISHPAGE_RUN $INSTDIR\bitcoin-qt.exe
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "../share/pixmaps/nsis-wizard.bmp"
@@ -45,21 +48,21 @@ Var StartMenuGroup
!insertmacro MUI_LANGUAGE English
# Installer attributes
-OutFile bitcoin-0.8.2-win32-setup.exe
-InstallDir $PROGRAMFILES\Bitcoin
+OutFile ${NAME}-${VERSION}-win32-setup.exe
@luke-jr

luke-jr Aug 20, 2013

Member

This changes the output filename to capitalized, but there is no corresponding capitalization expected by the gitian yml.

+InstallDir $PROGRAMFILES\${NAME}
CRCCheck on
XPStyle on
BrandingText " "
ShowInstDetails show
-VIProductVersion 0.8.2.2
-VIAddVersionKey ProductName Bitcoin
-VIAddVersionKey ProductVersion "${VERSION}"
+VIProductVersion ${PRODUCT_VERSION}
+VIAddVersionKey ProductName ${NAME}
+VIAddVersionKey ProductVersion ${VERSION}
VIAddVersionKey CompanyName "${COMPANY}"
VIAddVersionKey CompanyWebsite "${URL}"
-VIAddVersionKey FileVersion "${VERSION}"
+VIAddVersionKey FileVersion ${VERSION}
VIAddVersionKey FileDescription ""
VIAddVersionKey LegalCopyright ""
@Diapolo

Diapolo Jul 12, 2013

Should be changed to 2009-2013 The Bitcoin developers to match the source and even bitcoin-qt.exe metadata IMHO :).

-InstallDirRegKey HKCU "${REGKEY}" Path
+InstallDirRegKey HKLM "${REGKEY}" Path
ShowUninstDetails show
# Installer sections
@@ -74,40 +77,41 @@ Section -Main SEC0000
SetOutPath $INSTDIR\src
File /r /x *.exe /x *.o ../src\*.*
SetOutPath $INSTDIR
- WriteRegStr HKCU "${REGKEY}\Components" Main 1
+ WriteRegStr HKLM "${REGKEY}\Components" Main 1
# Remove old wxwidgets-based-bitcoin executable and locales:
Delete /REBOOTOK $INSTDIR\bitcoin.exe
RMDir /r /REBOOTOK $INSTDIR\locale
SectionEnd
Section -post SEC0001
- WriteRegStr HKCU "${REGKEY}" Path $INSTDIR
+ WriteRegStr HKLM "${REGKEY}" Path $INSTDIR
SetOutPath $INSTDIR
WriteUninstaller $INSTDIR\uninstall.exe
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
+ SetShellVarContext all
@Diapolo

Diapolo Dec 26, 2012

What is this one doing?

@da2ce7

da2ce7 Dec 27, 2012

It tells the uninstaller to uninstall the start menu items from the All Users location, not the (default) user local location.

CreateDirectory $SMPROGRAMS\$StartMenuGroup
- CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Bitcoin.lnk" $INSTDIR\bitcoin-qt.exe
- CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall Bitcoin.lnk" $INSTDIR\uninstall.exe
+ CreateShortcut "$SMPROGRAMS\$StartMenuGroup\${NAME}.lnk" $INSTDIR\bitcoin-qt.exe
+ CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall ${NAME}.lnk" $INSTDIR\uninstall.exe
!insertmacro MUI_STARTMENU_WRITE_END
- WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
- WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}"
- WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}"
- WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
- WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe
- WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
- WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
- WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" DisplayName "${NAME}"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" DisplayVersion "${VERSION}"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" Publisher "${COMPANY}"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" URLInfoAbout "${URL}"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" DisplayIcon $INSTDIR\uninstall.exe
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" UninstallString $INSTDIR\uninstall.exe
+ WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" NoModify 1
+ WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" NoRepair 1
WriteRegStr HKCR "bitcoin" "URL Protocol" ""
- WriteRegStr HKCR "bitcoin" "" "URL:Bitcoin"
+ WriteRegStr HKCR "bitcoin" "" "URL:${NAME}"
WriteRegStr HKCR "bitcoin\DefaultIcon" "" $INSTDIR\bitcoin-qt.exe
WriteRegStr HKCR "bitcoin\shell\open\command" "" '"$INSTDIR\bitcoin-qt.exe" "%1"'
SectionEnd
# Macro for selecting uninstaller sections
!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
Push $R0
- ReadRegStr $R0 HKCU "${REGKEY}\Components" "${SECTION_NAME}"
+ ReadRegStr $R0 HKLM "${REGKEY}\Components" "${SECTION_NAME}"
StrCmp $R0 1 0 next${UNSECTION_ID}
!insertmacro SelectSection "${UNSECTION_ID}"
GoTo done${UNSECTION_ID}
@@ -124,22 +128,23 @@ Section /o -un.Main UNSEC0000
Delete /REBOOTOK $INSTDIR\readme.txt
RMDir /r /REBOOTOK $INSTDIR\daemon
RMDir /r /REBOOTOK $INSTDIR\src
- DeleteRegValue HKCU "${REGKEY}\Components" Main
+ DeleteRegValue HKLM "${REGKEY}\Components" Main
SectionEnd
Section -un.post UNSEC0001
- DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
- Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall Bitcoin.lnk"
- Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Bitcoin.lnk"
- Delete /REBOOTOK "$SMSTARTUP\Bitcoin.lnk"
+ DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}"
+ SetShellVarContext all
+ Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall ${NAME}.lnk"
+ Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\${NAME}.lnk"
+ Delete /REBOOTOK "$SMSTARTUP\${NAME}.lnk"
Delete /REBOOTOK $INSTDIR\uninstall.exe
Delete /REBOOTOK $INSTDIR\debug.log
Delete /REBOOTOK $INSTDIR\db.log
- DeleteRegValue HKCU "${REGKEY}" StartMenuGroup
- DeleteRegValue HKCU "${REGKEY}" Path
- DeleteRegKey /IfEmpty HKCU "${REGKEY}\Components"
- DeleteRegKey /IfEmpty HKCU "${REGKEY}"
- DeleteRegKey HKCR "bitcoin"
+ DeleteRegValue HKLM "${REGKEY}" StartMenuGroup
+ DeleteRegValue HKLM "${REGKEY}" Path
+ DeleteRegKey /IfEmpty HKLM "${REGKEY}\Components"
+ DeleteRegKey /IfEmpty HKLM "${REGKEY}"
+ DeleteRegKey HKCR "${NAME}"
RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
RmDir /REBOOTOK $INSTDIR
Push $R0
@@ -156,7 +161,7 @@ FunctionEnd
# Uninstaller functions
Function un.onInit
- ReadRegStr $INSTDIR HKCU "${REGKEY}" Path
+ ReadRegStr $INSTDIR HKLM "${REGKEY}" Path
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup
!insertmacro SELECT_UNSECTION Main ${UNSEC0000}
FunctionEnd