@@ -115,23 +115,59 @@ RequestExecutionLevel "${REQUEST_EXECUTION_LEVEL}"
115115 WriteUninstaller " $INSTDIR\uninstall.exe"
116116
117117 SetRegView 64
118- WriteRegStr HKLM " ${UNINST_KEY}" " Publisher" " ${INFO_COMPANYNAME}"
119- WriteRegStr HKLM " ${UNINST_KEY}" " DisplayName" " ${INFO_PRODUCTNAME}"
120- WriteRegStr HKLM " ${UNINST_KEY}" " DisplayVersion" " ${INFO_PRODUCTVERSION}"
121- WriteRegStr HKLM " ${UNINST_KEY}" " DisplayIcon" " $INSTDIR\${PRODUCT_EXECUTABLE}"
122- WriteRegStr HKLM " ${UNINST_KEY}" " UninstallString" " $\" $INSTDIR\uninstall.exe$\" "
123- WriteRegStr HKLM " ${UNINST_KEY}" " QuietUninstallString" " $\" $INSTDIR\uninstall.exe$\" /S"
118+ !ifdef WAILS_INSTALL_SCOPE
119+ !if " ${WAILS_INSTALL_SCOPE}" == " user"
120+ WriteRegStr HKCU " ${UNINST_KEY}" " Publisher" " ${INFO_COMPANYNAME}"
121+ WriteRegStr HKCU " ${UNINST_KEY}" " DisplayName" " ${INFO_PRODUCTNAME}"
122+ WriteRegStr HKCU " ${UNINST_KEY}" " DisplayVersion" " ${INFO_PRODUCTVERSION}"
123+ WriteRegStr HKCU " ${UNINST_KEY}" " DisplayIcon" " $INSTDIR\${PRODUCT_EXECUTABLE}"
124+ WriteRegStr HKCU " ${UNINST_KEY}" " UninstallString" " $\" $INSTDIR\uninstall.exe$\" "
125+ WriteRegStr HKCU " ${UNINST_KEY}" " QuietUninstallString" " $\" $INSTDIR\uninstall.exe$\" /S"
126+ !else
127+ WriteRegStr HKLM " ${UNINST_KEY}" " Publisher" " ${INFO_COMPANYNAME}"
128+ WriteRegStr HKLM " ${UNINST_KEY}" " DisplayName" " ${INFO_PRODUCTNAME}"
129+ WriteRegStr HKLM " ${UNINST_KEY}" " DisplayVersion" " ${INFO_PRODUCTVERSION}"
130+ WriteRegStr HKLM " ${UNINST_KEY}" " DisplayIcon" " $INSTDIR\${PRODUCT_EXECUTABLE}"
131+ WriteRegStr HKLM " ${UNINST_KEY}" " UninstallString" " $\" $INSTDIR\uninstall.exe$\" "
132+ WriteRegStr HKLM " ${UNINST_KEY}" " QuietUninstallString" " $\" $INSTDIR\uninstall.exe$\" /S"
133+ !endif
134+ !else
135+ WriteRegStr HKLM " ${UNINST_KEY}" " Publisher" " ${INFO_COMPANYNAME}"
136+ WriteRegStr HKLM " ${UNINST_KEY}" " DisplayName" " ${INFO_PRODUCTNAME}"
137+ WriteRegStr HKLM " ${UNINST_KEY}" " DisplayVersion" " ${INFO_PRODUCTVERSION}"
138+ WriteRegStr HKLM " ${UNINST_KEY}" " DisplayIcon" " $INSTDIR\${PRODUCT_EXECUTABLE}"
139+ WriteRegStr HKLM " ${UNINST_KEY}" " UninstallString" " $\" $INSTDIR\uninstall.exe$\" "
140+ WriteRegStr HKLM " ${UNINST_KEY}" " QuietUninstallString" " $\" $INSTDIR\uninstall.exe$\" /S"
141+ !endif
124142
125143 ${GetSize} " $INSTDIR" " /S=0K" $0 $1 $2
126144 IntFmt $0 " 0x%08X" $0
127- WriteRegDWORD HKLM " ${UNINST_KEY}" " EstimatedSize" " $0"
145+
146+ !ifdef WAILS_INSTALL_SCOPE
147+ !if " ${WAILS_INSTALL_SCOPE}" == " user"
148+ WriteRegDWORD HKCU " ${UNINST_KEY}" " EstimatedSize" " $0"
149+ !else
150+ WriteRegDWORD HKLM " ${UNINST_KEY}" " EstimatedSize" " $0"
151+ !endif
152+ !else
153+ WriteRegDWORD HKLM " ${UNINST_KEY}" " EstimatedSize" " $0"
154+ !endif
128155!macroend
129156
130157!macro wails.deleteUninstaller
131158 Delete " $INSTDIR\uninstall.exe"
132159
133160 SetRegView 64
134- DeleteRegKey HKLM " ${UNINST_KEY}"
161+
162+ !ifdef WAILS_INSTALL_SCOPE
163+ !if " ${WAILS_INSTALL_SCOPE}" == " user"
164+ DeleteRegKey HKCU " ${UNINST_KEY}"
165+ !else
166+ DeleteRegKey HKLM " ${UNINST_KEY}"
167+ !endif
168+ !else
169+ DeleteRegKey HKLM " ${UNINST_KEY}"
170+ !endif
135171!macroend
136172
137173!macro wails.setShellContext
@@ -183,7 +219,6 @@ RequestExecutionLevel "${REQUEST_EXECUTION_LEVEL}"
183219 ; Backup the previously associated file class
184220 ReadRegStr $R0 SHELL_CONTEXT " Software\Classes\.${EXT}" " "
185221 WriteRegStr SHELL_CONTEXT " Software\Classes\.${EXT}" " ${FILECLASS}_backup" " $R0"
186-
187222 WriteRegStr SHELL_CONTEXT " Software\Classes\.${EXT}" " " " ${FILECLASS}"
188223
189224 WriteRegStr SHELL_CONTEXT " Software\Classes\${FILECLASS}" " " ` ${DESCRIPTION}`
0 commit comments