| 1 |
Name "Feather Wallet" |
| 2 |
|
| 3 |
OutFile "${CUR_PATH}\contrib\installers\windows\FeatherWalletSetup.exe" |
| 4 |
RequestExecutionLevel highest |
| 5 |
SetCompressor /SOLID lzma |
| 6 |
SetDateSave off |
| 7 |
Unicode true |
| 8 |
|
| 9 |
# Uncomment these lines when investigating reproducibility errors |
| 10 |
#SetCompress off |
| 11 |
#SetDatablockOptimize off |
| 12 |
|
| 13 |
# MUI Symbol Definitions |
| 14 |
!define MUI_ICON "${CUR_PATH}\contrib\installers\windows\appicon.ico" |
| 15 |
!define MUI_FINISHPAGE_NOAUTOCLOSE |
| 16 |
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "$(^Name)" |
| 17 |
!define MUI_FINISHPAGE_RUN "$WINDIR\explorer.exe" |
| 18 |
!define MUI_FINISHPAGE_RUN_PARAMETERS $INSTDIR\feather.exe |
| 19 |
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico" |
| 20 |
!define MUI_UNFINISHPAGE_NOAUTOCLOSE |
| 21 |
|
| 22 |
# Included files |
| 23 |
!include Sections.nsh |
| 24 |
!include MUI2.nsh |
| 25 |
!include x64.nsh |
| 26 |
!include WinVer.nsh |
| 27 |
|
| 28 |
# Variables |
| 29 |
Var StartMenuGroup |
| 30 |
|
| 31 |
# Installer pages |
| 32 |
!insertmacro MUI_PAGE_DIRECTORY |
| 33 |
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup |
| 34 |
!insertmacro MUI_PAGE_INSTFILES |
| 35 |
!insertmacro MUI_PAGE_FINISH |
| 36 |
!insertmacro MUI_UNPAGE_CONFIRM |
| 37 |
!insertmacro MUI_UNPAGE_INSTFILES |
| 38 |
|
| 39 |
# Installer languages |
| 40 |
!insertmacro MUI_LANGUAGE English |
| 41 |
|
| 42 |
# Installer attributes |
| 43 |
InstallDir "$PROGRAMFILES64\Feather Wallet" |
| 44 |
CRCCheck force |
| 45 |
XPStyle on |
| 46 |
BrandingText " " |
| 47 |
ShowInstDetails show |
| 48 |
VIProductVersion @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@[email protected] |
| 49 |
VIAddVersionKey ProductName "Feather Wallet" |
| 50 |
VIAddVersionKey ProductVersion "@PROJECT_VERSION@" |
| 51 |
VIAddVersionKey CompanyName "Feather Wallet" |
| 52 |
VIAddVersionKey CompanyWebsite "https://featherwallet.org" |
| 53 |
VIAddVersionKey FileVersion "@PROJECT_VERSION@" |
| 54 |
VIAddVersionKey FileDescription "Installer for Feather Wallet" |
| 55 |
VIAddVersionKey LegalCopyright "Copyright (C) 2020-@COPYRIGHT_YEAR@ @COPYRIGHT_HOLDERS@" |
| 56 |
ShowUninstDetails show |
| 57 |
|
| 58 |
# Installer sections |
| 59 |
Section -Main SEC0000 |
| 60 |
SetOutPath $INSTDIR |
| 61 |
SetOverwrite on |
| 62 |
File "${CUR_PATH}\build\bin\feather.exe" |
| 63 |
File /oname=LICENSE.txt "${CUR_PATH}\LICENSE" |
| 64 |
SetOutPath $INSTDIR\tor |
| 65 |
File /r \feather\contrib\depends\x86_64-w64-mingw32\Tor\*.* |
| 66 |
SetOutPath $INSTDIR |
| 67 |
SectionEnd |
| 68 |
|
| 69 |
Section -post SEC0001 |
| 70 |
SetOutPath $INSTDIR |
| 71 |
Delete /REBOOTOK "$INSTDIR\unins000.exe" |
| 72 |
Delete /REBOOTOK "$INSTDIR\unins000.dat" |
| 73 |
WriteUninstaller "$INSTDIR\uninstall.exe" |
| 74 |
SetShellVarContext all |
| 75 |
Delete /REBOOTOK "$SMPROGRAMS\Feather Wallet.lnk" |
| 76 |
SetShellVarContext current |
| 77 |
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application |
| 78 |
CreateDirectory $SMPROGRAMS\$StartMenuGroup |
| 79 |
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" $INSTDIR\feather.exe |
| 80 |
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\uninstall.exe |
| 81 |
CreateShortcut "$Desktop\$(^Name).lnk" "$InstDir\feather.exe" |
| 82 |
!insertmacro MUI_STARTMENU_WRITE_END |
| 83 |
SectionEnd |
| 84 |
|
| 85 |
# Uninstaller sections |
| 86 |
Section /o -un.Main UNSEC0000 |
| 87 |
Delete /REBOOTOK $INSTDIR\feather.exe |
| 88 |
Delete /REBOOTOK $INSTDIR\LICENSE.txt |
| 89 |
RMDir /r /REBOOTOK $INSTDIR\tor |
| 90 |
SectionEnd |
| 91 |
|
| 92 |
Section -un.post UNSEC0001 |
| 93 |
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" |
| 94 |
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" |
| 95 |
Delete /REBOOTOK "$Desktop\$(^Name).lnk" |
| 96 |
Delete /REBOOTOK $INSTDIR\uninstall.exe |
| 97 |
RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup |
| 98 |
RmDir /REBOOTOK $INSTDIR |
| 99 |
Push $R0 |
| 100 |
StrCpy $R0 $StartMenuGroup 1 |
| 101 |
StrCmp $R0 ">" no_smgroup |
| 102 |
no_smgroup: |
| 103 |
Pop $R0 |
| 104 |
SectionEnd |
| 105 |
|
| 106 |
# Installer functions |
| 107 |
Function .onInit |
| 108 |
InitPluginsDir |
| 109 |
${If} ${RunningX64} |
| 110 |
; disable registry redirection (enable access to 64-bit portion of registry) |
| 111 |
SetRegView 64 |
| 112 |
${Else} |
| 113 |
MessageBox MB_OK|MB_ICONSTOP "Cannot install 64-bit version on a 32-bit system." |
| 114 |
Abort |
| 115 |
${EndIf} |
| 116 |
${If} ${AtMostWin8.1} |
| 117 |
MessageBox MB_OK|MB_ICONSTOP "This version of Windows is not supported. Upgrade to Windows 10 or later." |
| 118 |
Abort |
| 119 |
${EndIf} |
| 120 |
FunctionEnd |
| 121 |
|
| 122 |
# Uninstaller functions |
| 123 |
Function un.onInit |
| 124 |
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup |
| 125 |
!insertmacro SelectSection ${UNSEC0000} |
| 126 |
FunctionEnd |