Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | # This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 4 | |
michael@0 | 5 | ; The registration ID of the COM server which is used for choosing wether |
michael@0 | 6 | ; to launch the Win8 metro browser or desktop browser. |
michael@0 | 7 | !define DELEGATE_EXECUTE_HANDLER_ID {5100FEC1-212B-4BF5-9BF8-3E650FD794A3} |
michael@0 | 8 | ; |
michael@0 | 9 | ; Defines for adjust token privs and for enumerating keys |
michael@0 | 10 | !ifndef TOKEN_QUERY |
michael@0 | 11 | !define TOKEN_QUERY 0x0008 |
michael@0 | 12 | !endif |
michael@0 | 13 | !ifndef TOKEN_ADJUST_PRIVILEGES |
michael@0 | 14 | !define TOKEN_ADJUST_PRIVILEGES 0x0020 |
michael@0 | 15 | !endif |
michael@0 | 16 | !ifndef SE_RESTORE_NAME |
michael@0 | 17 | !define SE_RESTORE_NAME SeRestorePrivilege |
michael@0 | 18 | !endif |
michael@0 | 19 | !ifndef SE_PRIVILEGE_ENABLED |
michael@0 | 20 | !define SE_PRIVILEGE_ENABLED 0x00000002 |
michael@0 | 21 | !endif |
michael@0 | 22 | !ifndef HKEY_USERS |
michael@0 | 23 | !define HKEY_USERS 0x80000003 |
michael@0 | 24 | !endif |
michael@0 | 25 | |
michael@0 | 26 | ; Does metro registration for the command execute handler |
michael@0 | 27 | Function RegisterCEH |
michael@0 | 28 | !ifdef MOZ_METRO |
michael@0 | 29 | ${If} ${AtLeastWin8} |
michael@0 | 30 | ${CleanupMetroBrowserHandlerValues} ${DELEGATE_EXECUTE_HANDLER_ID} \ |
michael@0 | 31 | "FirefoxURL" \ |
michael@0 | 32 | "FirefoxHTML" |
michael@0 | 33 | ${AddMetroBrowserHandlerValues} ${DELEGATE_EXECUTE_HANDLER_ID} \ |
michael@0 | 34 | "$INSTDIR\CommandExecuteHandler.exe" \ |
michael@0 | 35 | $AppUserModelID \ |
michael@0 | 36 | "FirefoxURL" \ |
michael@0 | 37 | "FirefoxHTML" |
michael@0 | 38 | ${EndIf} |
michael@0 | 39 | !endif |
michael@0 | 40 | FunctionEnd |
michael@0 | 41 | |
michael@0 | 42 | ; If we're in Win8 make sure we have a start menu shortcut and that it has |
michael@0 | 43 | ; the correct AppuserModelID so that the Metro browser has a Metro tile. |
michael@0 | 44 | Function RegisterStartMenuTile |
michael@0 | 45 | !ifdef MOZ_METRO |
michael@0 | 46 | ${If} ${AtLeastWin8} |
michael@0 | 47 | CreateShortCut "$SMPROGRAMS\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}" |
michael@0 | 48 | ${If} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk" |
michael@0 | 49 | ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandFullName}.lnk" \ |
michael@0 | 50 | "$INSTDIR" |
michael@0 | 51 | ${If} "$AppUserModelID" != "" |
michael@0 | 52 | ApplicationID::Set "$SMPROGRAMS\${BrandFullName}.lnk" "$AppUserModelID" "true" |
michael@0 | 53 | ${EndIf} |
michael@0 | 54 | ${EndIf} |
michael@0 | 55 | ${EndIf} |
michael@0 | 56 | !endif |
michael@0 | 57 | FunctionEnd |
michael@0 | 58 | |
michael@0 | 59 | !macro PostUpdate |
michael@0 | 60 | |
michael@0 | 61 | ; PostUpdate is called from both session 0 and from the user session |
michael@0 | 62 | ; for service updates, make sure that we only register with the user session |
michael@0 | 63 | ; Otherwise ApplicationID::Set can fail intermittently with a file in use error. |
michael@0 | 64 | System::Call "kernel32::GetCurrentProcessId() i.r0" |
michael@0 | 65 | System::Call "kernel32::ProcessIdToSessionId(i $0, *i ${NSIS_MAX_STRLEN} r9)" |
michael@0 | 66 | |
michael@0 | 67 | ; Determine if we're the protected UserChoice default or not. If so fix the |
michael@0 | 68 | ; start menu tile. In case there are 2 Firefox installations, we only do |
michael@0 | 69 | ; this if the application being updated is the default. |
michael@0 | 70 | ReadRegStr $0 HKCU "Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice" "ProgId" |
michael@0 | 71 | ${If} $0 == "FirefoxURL" |
michael@0 | 72 | ${AndIf} $9 != 0 ; We're not running in session 0 |
michael@0 | 73 | ReadRegStr $0 HKCU "Software\Classes\FirefoxURL\shell\open\command" "" |
michael@0 | 74 | ${GetPathFromString} "$0" $0 |
michael@0 | 75 | ${GetParent} "$0" $0 |
michael@0 | 76 | ${If} ${FileExists} "$0" |
michael@0 | 77 | ${GetLongPath} "$0" $0 |
michael@0 | 78 | ${EndIf} |
michael@0 | 79 | ${If} "$0" == "$INSTDIR" |
michael@0 | 80 | ; Win8 specific registration |
michael@0 | 81 | Call RegisterStartMenuTile |
michael@0 | 82 | ${EndIf} |
michael@0 | 83 | ${EndIf} |
michael@0 | 84 | |
michael@0 | 85 | ${CreateShortcutsLog} |
michael@0 | 86 | |
michael@0 | 87 | ; Remove registry entries for non-existent apps and for apps that point to our |
michael@0 | 88 | ; install location in the Software\Mozilla key and uninstall registry entries |
michael@0 | 89 | ; that point to our install location for both HKCU and HKLM. |
michael@0 | 90 | SetShellVarContext current ; Set SHCTX to the current user (e.g. HKCU) |
michael@0 | 91 | ${RegCleanMain} "Software\Mozilla" |
michael@0 | 92 | ${RegCleanUninstall} |
michael@0 | 93 | ${UpdateProtocolHandlers} |
michael@0 | 94 | |
michael@0 | 95 | ; setup the application model id registration value |
michael@0 | 96 | ${InitHashAppModelId} "$INSTDIR" "Software\Mozilla\${AppName}\TaskBarIDs" |
michael@0 | 97 | |
michael@0 | 98 | ; Win7 taskbar and start menu link maintenance |
michael@0 | 99 | Call FixShortcutAppModelIDs |
michael@0 | 100 | |
michael@0 | 101 | ClearErrors |
michael@0 | 102 | WriteRegStr HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" "Write Test" |
michael@0 | 103 | ${If} ${Errors} |
michael@0 | 104 | StrCpy $TmpVal "HKCU" ; used primarily for logging |
michael@0 | 105 | ${Else} |
michael@0 | 106 | SetShellVarContext all ; Set SHCTX to all users (e.g. HKLM) |
michael@0 | 107 | DeleteRegValue HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" |
michael@0 | 108 | StrCpy $TmpVal "HKLM" ; used primarily for logging |
michael@0 | 109 | ${RegCleanMain} "Software\Mozilla" |
michael@0 | 110 | ${RegCleanUninstall} |
michael@0 | 111 | ${UpdateProtocolHandlers} |
michael@0 | 112 | ${FixShellIconHandler} "HKLM" |
michael@0 | 113 | ${SetAppLSPCategories} ${LSP_CATEGORIES} |
michael@0 | 114 | |
michael@0 | 115 | ; Win7 taskbar and start menu link maintenance |
michael@0 | 116 | Call FixShortcutAppModelIDs |
michael@0 | 117 | |
michael@0 | 118 | ; Only update the Clients\StartMenuInternet registry key values in HKLM if |
michael@0 | 119 | ; they don't exist or this installation is the same as the one set in those |
michael@0 | 120 | ; keys. |
michael@0 | 121 | ${StrFilter} "${FileMainEXE}" "+" "" "" $1 |
michael@0 | 122 | ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\$1\DefaultIcon" "" |
michael@0 | 123 | ${GetPathFromString} "$0" $0 |
michael@0 | 124 | ${GetParent} "$0" $0 |
michael@0 | 125 | ${If} ${FileExists} "$0" |
michael@0 | 126 | ${GetLongPath} "$0" $0 |
michael@0 | 127 | ${EndIf} |
michael@0 | 128 | ${If} "$0" == "$INSTDIR" |
michael@0 | 129 | ${SetStartMenuInternet} "HKLM" |
michael@0 | 130 | ${EndIf} |
michael@0 | 131 | |
michael@0 | 132 | ; Only update the Clients\StartMenuInternet registry key values in HKCU if |
michael@0 | 133 | ; they don't exist or this installation is the same as the one set in those |
michael@0 | 134 | ; keys. This is only done in Windows 8 to avoid a UAC prompt. |
michael@0 | 135 | ${If} ${AtLeastWin8} |
michael@0 | 136 | ReadRegStr $0 HKCU "Software\Clients\StartMenuInternet\$1\DefaultIcon" "" |
michael@0 | 137 | ${GetPathFromString} "$0" $0 |
michael@0 | 138 | ${GetParent} "$0" $0 |
michael@0 | 139 | ${If} ${FileExists} "$0" |
michael@0 | 140 | ${GetLongPath} "$0" $0 |
michael@0 | 141 | ${EndIf} |
michael@0 | 142 | ${If} "$0" == "$INSTDIR" |
michael@0 | 143 | ${SetStartMenuInternet} "HKCU" |
michael@0 | 144 | ${EndIf} |
michael@0 | 145 | ${EndIf} |
michael@0 | 146 | |
michael@0 | 147 | ReadRegStr $0 HKLM "Software\mozilla.org\Mozilla" "CurrentVersion" |
michael@0 | 148 | ${If} "$0" != "${GREVersion}" |
michael@0 | 149 | WriteRegStr HKLM "Software\mozilla.org\Mozilla" "CurrentVersion" "${GREVersion}" |
michael@0 | 150 | ${EndIf} |
michael@0 | 151 | ${EndIf} |
michael@0 | 152 | |
michael@0 | 153 | ; Migrate the application's Start Menu directory to a single shortcut in the |
michael@0 | 154 | ; root of the Start Menu Programs directory. |
michael@0 | 155 | ${MigrateStartMenuShortcut} |
michael@0 | 156 | |
michael@0 | 157 | ; Adds a pinned Task Bar shortcut (see MigrateTaskBarShortcut for details). |
michael@0 | 158 | ${MigrateTaskBarShortcut} |
michael@0 | 159 | |
michael@0 | 160 | ${RemoveDeprecatedKeys} |
michael@0 | 161 | |
michael@0 | 162 | ${SetAppKeys} |
michael@0 | 163 | ${FixClassKeys} |
michael@0 | 164 | ${SetUninstallKeys} |
michael@0 | 165 | |
michael@0 | 166 | ; Remove files that may be left behind by the application in the |
michael@0 | 167 | ; VirtualStore directory. |
michael@0 | 168 | ${CleanVirtualStore} |
michael@0 | 169 | |
michael@0 | 170 | ${RemoveDeprecatedFiles} |
michael@0 | 171 | |
michael@0 | 172 | ; Fix the distribution.ini file if applicable |
michael@0 | 173 | ${FixDistributionsINI} |
michael@0 | 174 | |
michael@0 | 175 | RmDir /r /REBOOTOK "$INSTDIR\${TO_BE_DELETED}" |
michael@0 | 176 | |
michael@0 | 177 | !ifdef MOZ_MAINTENANCE_SERVICE |
michael@0 | 178 | Call IsUserAdmin |
michael@0 | 179 | Pop $R0 |
michael@0 | 180 | ${If} $R0 == "true" |
michael@0 | 181 | ; Only proceed if we have HKLM write access |
michael@0 | 182 | ${AndIf} $TmpVal == "HKLM" |
michael@0 | 183 | ; On Windows 2000 we do not install the maintenance service. |
michael@0 | 184 | ${AndIf} ${AtLeastWinXP} |
michael@0 | 185 | ; Add the registry keys for allowed certificates. |
michael@0 | 186 | ${AddMaintCertKeys} |
michael@0 | 187 | |
michael@0 | 188 | ; We check to see if the maintenance service install was already attempted. |
michael@0 | 189 | ; Since the Maintenance service can be installed either x86 or x64, |
michael@0 | 190 | ; always use the 64-bit registry for checking if an attempt was made. |
michael@0 | 191 | ${If} ${RunningX64} |
michael@0 | 192 | SetRegView 64 |
michael@0 | 193 | ${EndIf} |
michael@0 | 194 | ReadRegDWORD $5 HKLM "Software\Mozilla\MaintenanceService" "Attempted" |
michael@0 | 195 | ClearErrors |
michael@0 | 196 | ${If} ${RunningX64} |
michael@0 | 197 | SetRegView lastused |
michael@0 | 198 | ${EndIf} |
michael@0 | 199 | |
michael@0 | 200 | ; If the maintenance service is already installed, do nothing. |
michael@0 | 201 | ; The maintenance service will launch: |
michael@0 | 202 | ; maintenanceservice_installer.exe /Upgrade to upgrade the maintenance |
michael@0 | 203 | ; service if necessary. If the update was done from updater.exe without |
michael@0 | 204 | ; the service (i.e. service is failing), updater.exe will do the update of |
michael@0 | 205 | ; the service. The reasons we do not do it here is because we don't want |
michael@0 | 206 | ; to have to prompt for limited user accounts when the service isn't used |
michael@0 | 207 | ; and we currently call the PostUpdate twice, once for the user and once |
michael@0 | 208 | ; for the SYSTEM account. Also, this would stop the maintenance service |
michael@0 | 209 | ; and we need a return result back to the service when run that way. |
michael@0 | 210 | ${If} $5 == "" |
michael@0 | 211 | ; An install of maintenance service was never attempted. |
michael@0 | 212 | ; We know we are an Admin and that we have write access into HKLM |
michael@0 | 213 | ; based on the above checks, so attempt to just run the EXE. |
michael@0 | 214 | ; In the worst case, in case there is some edge case with the |
michael@0 | 215 | ; IsAdmin check and the permissions check, the maintenance service |
michael@0 | 216 | ; will just fail to be attempted to be installed. |
michael@0 | 217 | nsExec::Exec "$\"$INSTDIR\maintenanceservice_installer.exe$\"" |
michael@0 | 218 | ${EndIf} |
michael@0 | 219 | ${EndIf} |
michael@0 | 220 | !endif |
michael@0 | 221 | |
michael@0 | 222 | ; Register the DEH |
michael@0 | 223 | !ifdef MOZ_METRO |
michael@0 | 224 | ${If} ${AtLeastWin8} |
michael@0 | 225 | ${AndIf} $9 != 0 ; We're not running in session 0 |
michael@0 | 226 | ; If RegisterCEH is called too close to changing the shortcut AppUserModelID |
michael@0 | 227 | ; and if the tile image is not already in cache. Then Windows won't refresh |
michael@0 | 228 | ; the tile image on the start screen. So wait before calling RegisterCEH. |
michael@0 | 229 | ; We only need to do this when the DEH doesn't already exist. |
michael@0 | 230 | ReadRegStr $0 HKCU "Software\Classes\FirefoxURL\shell\open\command" "DelegateExecute" |
michael@0 | 231 | ${If} $0 != ${DELEGATE_EXECUTE_HANDLER_ID} |
michael@0 | 232 | Sleep 3000 |
michael@0 | 233 | ${EndIf} |
michael@0 | 234 | Call RegisterCEH |
michael@0 | 235 | ${EndIf} |
michael@0 | 236 | !else |
michael@0 | 237 | ; The metro browser is not enabled by the mozconfig. |
michael@0 | 238 | ${If} ${AtLeastWin8} |
michael@0 | 239 | ${RemoveDEHRegistration} ${DELEGATE_EXECUTE_HANDLER_ID} \ |
michael@0 | 240 | $AppUserModelID \ |
michael@0 | 241 | "FirefoxURL" \ |
michael@0 | 242 | "FirefoxHTML" |
michael@0 | 243 | ${EndIf} |
michael@0 | 244 | !endif |
michael@0 | 245 | !macroend |
michael@0 | 246 | !define PostUpdate "!insertmacro PostUpdate" |
michael@0 | 247 | |
michael@0 | 248 | !macro SetAsDefaultAppGlobal |
michael@0 | 249 | ${RemoveDeprecatedKeys} ; Does not use SHCTX |
michael@0 | 250 | |
michael@0 | 251 | SetShellVarContext all ; Set SHCTX to all users (e.g. HKLM) |
michael@0 | 252 | ${SetHandlers} ; Uses SHCTX |
michael@0 | 253 | ${SetStartMenuInternet} "HKLM" |
michael@0 | 254 | ${FixShellIconHandler} "HKLM" |
michael@0 | 255 | ${ShowShortcuts} |
michael@0 | 256 | ${StrFilter} "${FileMainEXE}" "+" "" "" $R9 |
michael@0 | 257 | WriteRegStr HKLM "Software\Clients\StartMenuInternet" "" "$R9" |
michael@0 | 258 | !macroend |
michael@0 | 259 | !define SetAsDefaultAppGlobal "!insertmacro SetAsDefaultAppGlobal" |
michael@0 | 260 | |
michael@0 | 261 | ; Removes shortcuts for this installation. This should also remove the |
michael@0 | 262 | ; application from Open With for the file types the application handles |
michael@0 | 263 | ; (bug 370480). |
michael@0 | 264 | !macro HideShortcuts |
michael@0 | 265 | ${StrFilter} "${FileMainEXE}" "+" "" "" $0 |
michael@0 | 266 | StrCpy $R1 "Software\Clients\StartMenuInternet\$0\InstallInfo" |
michael@0 | 267 | WriteRegDWORD HKLM "$R1" "IconsVisible" 0 |
michael@0 | 268 | ${If} ${AtLeastWin8} |
michael@0 | 269 | WriteRegDWORD HKCU "$R1" "IconsVisible" 0 |
michael@0 | 270 | ${EndIf} |
michael@0 | 271 | |
michael@0 | 272 | SetShellVarContext all ; Set $DESKTOP to All Users |
michael@0 | 273 | ${Unless} ${FileExists} "$DESKTOP\${BrandFullName}.lnk" |
michael@0 | 274 | SetShellVarContext current ; Set $DESKTOP to the current user's desktop |
michael@0 | 275 | ${EndUnless} |
michael@0 | 276 | |
michael@0 | 277 | ${If} ${FileExists} "$DESKTOP\${BrandFullName}.lnk" |
michael@0 | 278 | ShellLink::GetShortCutArgs "$DESKTOP\${BrandFullName}.lnk" |
michael@0 | 279 | Pop $0 |
michael@0 | 280 | ${If} "$0" == "" |
michael@0 | 281 | ShellLink::GetShortCutTarget "$DESKTOP\${BrandFullName}.lnk" |
michael@0 | 282 | Pop $0 |
michael@0 | 283 | ${GetLongPath} "$0" $0 |
michael@0 | 284 | ${If} "$0" == "$INSTDIR\${FileMainEXE}" |
michael@0 | 285 | Delete "$DESKTOP\${BrandFullName}.lnk" |
michael@0 | 286 | ${EndIf} |
michael@0 | 287 | ${EndIf} |
michael@0 | 288 | ${EndIf} |
michael@0 | 289 | |
michael@0 | 290 | SetShellVarContext all ; Set $SMPROGRAMS to All Users |
michael@0 | 291 | ${Unless} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk" |
michael@0 | 292 | SetShellVarContext current ; Set $SMPROGRAMS to the current user's Start |
michael@0 | 293 | ; Menu Programs directory |
michael@0 | 294 | ${EndUnless} |
michael@0 | 295 | |
michael@0 | 296 | ${If} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk" |
michael@0 | 297 | ShellLink::GetShortCutArgs "$SMPROGRAMS\${BrandFullName}.lnk" |
michael@0 | 298 | Pop $0 |
michael@0 | 299 | ${If} "$0" == "" |
michael@0 | 300 | ShellLink::GetShortCutTarget "$SMPROGRAMS\${BrandFullName}.lnk" |
michael@0 | 301 | Pop $0 |
michael@0 | 302 | ${GetLongPath} "$0" $0 |
michael@0 | 303 | ${If} "$0" == "$INSTDIR\${FileMainEXE}" |
michael@0 | 304 | Delete "$SMPROGRAMS\${BrandFullName}.lnk" |
michael@0 | 305 | ${EndIf} |
michael@0 | 306 | ${EndIf} |
michael@0 | 307 | ${EndIf} |
michael@0 | 308 | |
michael@0 | 309 | ${If} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk" |
michael@0 | 310 | ShellLink::GetShortCutArgs "$QUICKLAUNCH\${BrandFullName}.lnk" |
michael@0 | 311 | Pop $0 |
michael@0 | 312 | ${If} "$0" == "" |
michael@0 | 313 | ShellLink::GetShortCutTarget "$QUICKLAUNCH\${BrandFullName}.lnk" |
michael@0 | 314 | Pop $0 |
michael@0 | 315 | ${GetLongPath} "$0" $0 |
michael@0 | 316 | ${If} "$0" == "$INSTDIR\${FileMainEXE}" |
michael@0 | 317 | Delete "$QUICKLAUNCH\${BrandFullName}.lnk" |
michael@0 | 318 | ${EndIf} |
michael@0 | 319 | ${EndIf} |
michael@0 | 320 | ${EndIf} |
michael@0 | 321 | !macroend |
michael@0 | 322 | !define HideShortcuts "!insertmacro HideShortcuts" |
michael@0 | 323 | |
michael@0 | 324 | ; Adds shortcuts for this installation. This should also add the application |
michael@0 | 325 | ; to Open With for the file types the application handles (bug 370480). |
michael@0 | 326 | !macro ShowShortcuts |
michael@0 | 327 | ${StrFilter} "${FileMainEXE}" "+" "" "" $0 |
michael@0 | 328 | StrCpy $R1 "Software\Clients\StartMenuInternet\$0\InstallInfo" |
michael@0 | 329 | WriteRegDWORD HKLM "$R1" "IconsVisible" 1 |
michael@0 | 330 | ${If} ${AtLeastWin8} |
michael@0 | 331 | WriteRegDWORD HKCU "$R1" "IconsVisible" 1 |
michael@0 | 332 | ${EndIf} |
michael@0 | 333 | |
michael@0 | 334 | SetShellVarContext all ; Set $DESKTOP to All Users |
michael@0 | 335 | ${Unless} ${FileExists} "$DESKTOP\${BrandFullName}.lnk" |
michael@0 | 336 | CreateShortCut "$DESKTOP\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}" |
michael@0 | 337 | ${If} ${FileExists} "$DESKTOP\${BrandFullName}.lnk" |
michael@0 | 338 | ShellLink::SetShortCutWorkingDirectory "$DESKTOP\${BrandFullName}.lnk" "$INSTDIR" |
michael@0 | 339 | ${If} ${AtLeastWin7} |
michael@0 | 340 | ${AndIf} "$AppUserModelID" != "" |
michael@0 | 341 | ApplicationID::Set "$DESKTOP\${BrandFullName}.lnk" "$AppUserModelID" "true" |
michael@0 | 342 | ${EndIf} |
michael@0 | 343 | ${Else} |
michael@0 | 344 | SetShellVarContext current ; Set $DESKTOP to the current user's desktop |
michael@0 | 345 | ${Unless} ${FileExists} "$DESKTOP\${BrandFullName}.lnk" |
michael@0 | 346 | CreateShortCut "$DESKTOP\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}" |
michael@0 | 347 | ${If} ${FileExists} "$DESKTOP\${BrandFullName}.lnk" |
michael@0 | 348 | ShellLink::SetShortCutWorkingDirectory "$DESKTOP\${BrandFullName}.lnk" \ |
michael@0 | 349 | "$INSTDIR" |
michael@0 | 350 | ${If} ${AtLeastWin7} |
michael@0 | 351 | ${AndIf} "$AppUserModelID" != "" |
michael@0 | 352 | ApplicationID::Set "$DESKTOP\${BrandFullName}.lnk" "$AppUserModelID" "true" |
michael@0 | 353 | ${EndIf} |
michael@0 | 354 | ${EndIf} |
michael@0 | 355 | ${EndUnless} |
michael@0 | 356 | ${EndIf} |
michael@0 | 357 | ${EndUnless} |
michael@0 | 358 | |
michael@0 | 359 | SetShellVarContext all ; Set $SMPROGRAMS to All Users |
michael@0 | 360 | ${Unless} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk" |
michael@0 | 361 | CreateShortCut "$SMPROGRAMS\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}" |
michael@0 | 362 | ${If} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk" |
michael@0 | 363 | ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandFullName}.lnk" \ |
michael@0 | 364 | "$INSTDIR" |
michael@0 | 365 | ${If} ${AtLeastWin7} |
michael@0 | 366 | ${AndIf} "$AppUserModelID" != "" |
michael@0 | 367 | ApplicationID::Set "$SMPROGRAMS\${BrandFullName}.lnk" "$AppUserModelID" "true" |
michael@0 | 368 | ${EndIf} |
michael@0 | 369 | ${Else} |
michael@0 | 370 | SetShellVarContext current ; Set $SMPROGRAMS to the current user's Start |
michael@0 | 371 | ; Menu Programs directory |
michael@0 | 372 | ${Unless} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk" |
michael@0 | 373 | CreateShortCut "$SMPROGRAMS\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}" |
michael@0 | 374 | ${If} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk" |
michael@0 | 375 | ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandFullName}.lnk" \ |
michael@0 | 376 | "$INSTDIR" |
michael@0 | 377 | ${If} ${AtLeastWin7} |
michael@0 | 378 | ${AndIf} "$AppUserModelID" != "" |
michael@0 | 379 | ApplicationID::Set "$SMPROGRAMS\${BrandFullName}.lnk" "$AppUserModelID" "true" |
michael@0 | 380 | ${EndIf} |
michael@0 | 381 | ${EndIf} |
michael@0 | 382 | ${EndUnless} |
michael@0 | 383 | ${EndIf} |
michael@0 | 384 | ${EndUnless} |
michael@0 | 385 | |
michael@0 | 386 | ; Windows 7 doesn't use the QuickLaunch directory |
michael@0 | 387 | ${Unless} ${AtLeastWin7} |
michael@0 | 388 | ${AndUnless} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk" |
michael@0 | 389 | CreateShortCut "$QUICKLAUNCH\${BrandFullName}.lnk" \ |
michael@0 | 390 | "$INSTDIR\${FileMainEXE}" |
michael@0 | 391 | ${If} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk" |
michael@0 | 392 | ShellLink::SetShortCutWorkingDirectory "$QUICKLAUNCH\${BrandFullName}.lnk" \ |
michael@0 | 393 | "$INSTDIR" |
michael@0 | 394 | ${EndIf} |
michael@0 | 395 | ${EndUnless} |
michael@0 | 396 | !macroend |
michael@0 | 397 | !define ShowShortcuts "!insertmacro ShowShortcuts" |
michael@0 | 398 | |
michael@0 | 399 | !macro AddAssociationIfNoneExist FILE_TYPE |
michael@0 | 400 | ClearErrors |
michael@0 | 401 | EnumRegKey $7 HKCR "${FILE_TYPE}" 0 |
michael@0 | 402 | ${If} ${Errors} |
michael@0 | 403 | WriteRegStr SHCTX "SOFTWARE\Classes\${FILE_TYPE}" "" "FirefoxHTML" |
michael@0 | 404 | ${EndIf} |
michael@0 | 405 | !macroend |
michael@0 | 406 | !define AddAssociationIfNoneExist "!insertmacro AddAssociationIfNoneExist" |
michael@0 | 407 | |
michael@0 | 408 | ; Adds the protocol and file handler registry entries for making Firefox the |
michael@0 | 409 | ; default handler (uses SHCTX). |
michael@0 | 410 | !macro SetHandlers |
michael@0 | 411 | ${GetLongPath} "$INSTDIR\${FileMainEXE}" $8 |
michael@0 | 412 | |
michael@0 | 413 | StrCpy $0 "SOFTWARE\Classes" |
michael@0 | 414 | StrCpy $2 "$\"$8$\" -osint -url $\"%1$\"" |
michael@0 | 415 | |
michael@0 | 416 | ; Associate the file handlers with FirefoxHTML |
michael@0 | 417 | ReadRegStr $6 SHCTX "$0\.htm" "" |
michael@0 | 418 | ${If} "$6" != "FirefoxHTML" |
michael@0 | 419 | WriteRegStr SHCTX "$0\.htm" "" "FirefoxHTML" |
michael@0 | 420 | ${EndIf} |
michael@0 | 421 | |
michael@0 | 422 | ReadRegStr $6 SHCTX "$0\.html" "" |
michael@0 | 423 | ${If} "$6" != "FirefoxHTML" |
michael@0 | 424 | WriteRegStr SHCTX "$0\.html" "" "FirefoxHTML" |
michael@0 | 425 | ${EndIf} |
michael@0 | 426 | |
michael@0 | 427 | ReadRegStr $6 SHCTX "$0\.shtml" "" |
michael@0 | 428 | ${If} "$6" != "FirefoxHTML" |
michael@0 | 429 | WriteRegStr SHCTX "$0\.shtml" "" "FirefoxHTML" |
michael@0 | 430 | ${EndIf} |
michael@0 | 431 | |
michael@0 | 432 | ReadRegStr $6 SHCTX "$0\.xht" "" |
michael@0 | 433 | ${If} "$6" != "FirefoxHTML" |
michael@0 | 434 | WriteRegStr SHCTX "$0\.xht" "" "FirefoxHTML" |
michael@0 | 435 | ${EndIf} |
michael@0 | 436 | |
michael@0 | 437 | ReadRegStr $6 SHCTX "$0\.xhtml" "" |
michael@0 | 438 | ${If} "$6" != "FirefoxHTML" |
michael@0 | 439 | WriteRegStr SHCTX "$0\.xhtml" "" "FirefoxHTML" |
michael@0 | 440 | ${EndIf} |
michael@0 | 441 | |
michael@0 | 442 | ${AddAssociationIfNoneExist} ".pdf" |
michael@0 | 443 | ${AddAssociationIfNoneExist} ".oga" |
michael@0 | 444 | ${AddAssociationIfNoneExist} ".ogg" |
michael@0 | 445 | ${AddAssociationIfNoneExist} ".ogv" |
michael@0 | 446 | ${AddAssociationIfNoneExist} ".pdf" |
michael@0 | 447 | ${AddAssociationIfNoneExist} ".webm" |
michael@0 | 448 | |
michael@0 | 449 | ; An empty string is used for the 5th param because FirefoxHTML is not a |
michael@0 | 450 | ; protocol handler |
michael@0 | 451 | ${AddDisabledDDEHandlerValues} "FirefoxHTML" "$2" "$8,1" \ |
michael@0 | 452 | "${AppRegName} HTML Document" "" |
michael@0 | 453 | |
michael@0 | 454 | ${AddDisabledDDEHandlerValues} "FirefoxURL" "$2" "$8,1" "${AppRegName} URL" \ |
michael@0 | 455 | "true" |
michael@0 | 456 | Call RegisterCEH |
michael@0 | 457 | |
michael@0 | 458 | ; An empty string is used for the 4th & 5th params because the following |
michael@0 | 459 | ; protocol handlers already have a display name and the additional keys |
michael@0 | 460 | ; required for a protocol handler. |
michael@0 | 461 | ${AddDisabledDDEHandlerValues} "ftp" "$2" "$8,1" "" "" |
michael@0 | 462 | ${AddDisabledDDEHandlerValues} "http" "$2" "$8,1" "" "" |
michael@0 | 463 | ${AddDisabledDDEHandlerValues} "https" "$2" "$8,1" "" "" |
michael@0 | 464 | !macroend |
michael@0 | 465 | !define SetHandlers "!insertmacro SetHandlers" |
michael@0 | 466 | |
michael@0 | 467 | ; Adds the HKLM\Software\Clients\StartMenuInternet\FIREFOX.EXE registry |
michael@0 | 468 | ; entries (does not use SHCTX). |
michael@0 | 469 | ; |
michael@0 | 470 | ; The values for StartMenuInternet are only valid under HKLM and there can only |
michael@0 | 471 | ; be one installation registerred under StartMenuInternet per application since |
michael@0 | 472 | ; the key name is derived from the main application executable. |
michael@0 | 473 | ; http://support.microsoft.com/kb/297878 |
michael@0 | 474 | ; |
michael@0 | 475 | ; In Windows 8 this changes slightly, you can store StartMenuInternet entries in |
michael@0 | 476 | ; HKCU. The icon in start menu for StartMenuInternet is deprecated as of Win7, |
michael@0 | 477 | ; but the subkeys are what's important. Control panel default programs looks |
michael@0 | 478 | ; for them only in HKLM pre win8. |
michael@0 | 479 | ; |
michael@0 | 480 | ; Note: we might be able to get away with using the full path to the |
michael@0 | 481 | ; application executable for the key name in order to support multiple |
michael@0 | 482 | ; installations. |
michael@0 | 483 | !macro SetStartMenuInternet RegKey |
michael@0 | 484 | ${GetLongPath} "$INSTDIR\${FileMainEXE}" $8 |
michael@0 | 485 | ${GetLongPath} "$INSTDIR\uninstall\helper.exe" $7 |
michael@0 | 486 | |
michael@0 | 487 | ${StrFilter} "${FileMainEXE}" "+" "" "" $R9 |
michael@0 | 488 | |
michael@0 | 489 | StrCpy $0 "Software\Clients\StartMenuInternet\$R9" |
michael@0 | 490 | |
michael@0 | 491 | WriteRegStr ${RegKey} "$0" "" "${BrandFullName}" |
michael@0 | 492 | |
michael@0 | 493 | WriteRegStr ${RegKey} "$0\DefaultIcon" "" "$8,0" |
michael@0 | 494 | |
michael@0 | 495 | ; The Reinstall Command is defined at |
michael@0 | 496 | ; http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_adv/registeringapps.asp |
michael@0 | 497 | WriteRegStr ${RegKey} "$0\InstallInfo" "HideIconsCommand" "$\"$7$\" /HideShortcuts" |
michael@0 | 498 | WriteRegStr ${RegKey} "$0\InstallInfo" "ShowIconsCommand" "$\"$7$\" /ShowShortcuts" |
michael@0 | 499 | WriteRegStr ${RegKey} "$0\InstallInfo" "ReinstallCommand" "$\"$7$\" /SetAsDefaultAppGlobal" |
michael@0 | 500 | |
michael@0 | 501 | ClearErrors |
michael@0 | 502 | ReadRegDWORD $1 ${RegKey} "$0\InstallInfo" "IconsVisible" |
michael@0 | 503 | ; If the IconsVisible name value pair doesn't exist add it otherwise the |
michael@0 | 504 | ; application won't be displayed in Set Program Access and Defaults. |
michael@0 | 505 | ${If} ${Errors} |
michael@0 | 506 | ${If} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk" |
michael@0 | 507 | WriteRegDWORD ${RegKey} "$0\InstallInfo" "IconsVisible" 1 |
michael@0 | 508 | ${Else} |
michael@0 | 509 | WriteRegDWORD ${RegKey} "$0\InstallInfo" "IconsVisible" 0 |
michael@0 | 510 | ${EndIf} |
michael@0 | 511 | ${EndIf} |
michael@0 | 512 | |
michael@0 | 513 | WriteRegStr ${RegKey} "$0\shell\open\command" "" "$\"$8$\"" |
michael@0 | 514 | |
michael@0 | 515 | WriteRegStr ${RegKey} "$0\shell\properties" "" "$(CONTEXT_OPTIONS)" |
michael@0 | 516 | WriteRegStr ${RegKey} "$0\shell\properties\command" "" "$\"$8$\" -preferences" |
michael@0 | 517 | |
michael@0 | 518 | WriteRegStr ${RegKey} "$0\shell\safemode" "" "$(CONTEXT_SAFE_MODE)" |
michael@0 | 519 | WriteRegStr ${RegKey} "$0\shell\safemode\command" "" "$\"$8$\" -safe-mode" |
michael@0 | 520 | |
michael@0 | 521 | ; Vista Capabilities registry keys |
michael@0 | 522 | WriteRegStr ${RegKey} "$0\Capabilities" "ApplicationDescription" "$(REG_APP_DESC)" |
michael@0 | 523 | WriteRegStr ${RegKey} "$0\Capabilities" "ApplicationIcon" "$8,0" |
michael@0 | 524 | WriteRegStr ${RegKey} "$0\Capabilities" "ApplicationName" "${BrandShortName}" |
michael@0 | 525 | |
michael@0 | 526 | WriteRegStr ${RegKey} "$0\Capabilities\FileAssociations" ".htm" "FirefoxHTML" |
michael@0 | 527 | WriteRegStr ${RegKey} "$0\Capabilities\FileAssociations" ".html" "FirefoxHTML" |
michael@0 | 528 | WriteRegStr ${RegKey} "$0\Capabilities\FileAssociations" ".shtml" "FirefoxHTML" |
michael@0 | 529 | WriteRegStr ${RegKey} "$0\Capabilities\FileAssociations" ".xht" "FirefoxHTML" |
michael@0 | 530 | WriteRegStr ${RegKey} "$0\Capabilities\FileAssociations" ".xhtml" "FirefoxHTML" |
michael@0 | 531 | |
michael@0 | 532 | WriteRegStr ${RegKey} "$0\Capabilities\StartMenu" "StartMenuInternet" "$R9" |
michael@0 | 533 | |
michael@0 | 534 | WriteRegStr ${RegKey} "$0\Capabilities\URLAssociations" "ftp" "FirefoxURL" |
michael@0 | 535 | WriteRegStr ${RegKey} "$0\Capabilities\URLAssociations" "http" "FirefoxURL" |
michael@0 | 536 | WriteRegStr ${RegKey} "$0\Capabilities\URLAssociations" "https" "FirefoxURL" |
michael@0 | 537 | |
michael@0 | 538 | ; Vista Registered Application |
michael@0 | 539 | WriteRegStr ${RegKey} "Software\RegisteredApplications" "${AppRegName}" "$0\Capabilities" |
michael@0 | 540 | !macroend |
michael@0 | 541 | !define SetStartMenuInternet "!insertmacro SetStartMenuInternet" |
michael@0 | 542 | |
michael@0 | 543 | ; The IconHandler reference for FirefoxHTML can end up in an inconsistent state |
michael@0 | 544 | ; due to changes not being detected by the IconHandler for side by side |
michael@0 | 545 | ; installs (see bug 268512). The symptoms can be either an incorrect icon or no |
michael@0 | 546 | ; icon being displayed for files associated with Firefox (does not use SHCTX). |
michael@0 | 547 | !macro FixShellIconHandler RegKey |
michael@0 | 548 | ClearErrors |
michael@0 | 549 | ReadRegStr $1 ${RegKey} "Software\Classes\FirefoxHTML\ShellEx\IconHandler" "" |
michael@0 | 550 | ${Unless} ${Errors} |
michael@0 | 551 | ReadRegStr $1 ${RegKey} "Software\Classes\FirefoxHTML\DefaultIcon" "" |
michael@0 | 552 | ${GetLongPath} "$INSTDIR\${FileMainEXE}" $2 |
michael@0 | 553 | ${If} "$1" != "$2,1" |
michael@0 | 554 | WriteRegStr ${RegKey} "Software\Classes\FirefoxHTML\DefaultIcon" "" "$2,1" |
michael@0 | 555 | ${EndIf} |
michael@0 | 556 | ${EndUnless} |
michael@0 | 557 | !macroend |
michael@0 | 558 | !define FixShellIconHandler "!insertmacro FixShellIconHandler" |
michael@0 | 559 | |
michael@0 | 560 | ; Add Software\Mozilla\ registry entries (uses SHCTX). |
michael@0 | 561 | !macro SetAppKeys |
michael@0 | 562 | ; Check if this is an ESR release and if so add registry values so it is |
michael@0 | 563 | ; possible to determine that this is an ESR install (bug 726781). |
michael@0 | 564 | ClearErrors |
michael@0 | 565 | ${WordFind} "${UpdateChannel}" "esr" "E#" $3 |
michael@0 | 566 | ${If} ${Errors} |
michael@0 | 567 | StrCpy $3 "" |
michael@0 | 568 | ${Else} |
michael@0 | 569 | StrCpy $3 " ESR" |
michael@0 | 570 | ${EndIf} |
michael@0 | 571 | |
michael@0 | 572 | ${GetLongPath} "$INSTDIR" $8 |
michael@0 | 573 | StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}\${AppVersion}$3 (${ARCH} ${AB_CD})\Main" |
michael@0 | 574 | ${WriteRegStr2} $TmpVal "$0" "Install Directory" "$8" 0 |
michael@0 | 575 | ${WriteRegStr2} $TmpVal "$0" "PathToExe" "$8\${FileMainEXE}" 0 |
michael@0 | 576 | |
michael@0 | 577 | StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}\${AppVersion}$3 (${ARCH} ${AB_CD})\Uninstall" |
michael@0 | 578 | ${WriteRegStr2} $TmpVal "$0" "Description" "${BrandFullNameInternal} ${AppVersion}$3 (${ARCH} ${AB_CD})" 0 |
michael@0 | 579 | |
michael@0 | 580 | StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}\${AppVersion}$3 (${ARCH} ${AB_CD})" |
michael@0 | 581 | ${WriteRegStr2} $TmpVal "$0" "" "${AppVersion}$3 (${ARCH} ${AB_CD})" 0 |
michael@0 | 582 | ${If} "$3" == "" |
michael@0 | 583 | DeleteRegValue SHCTX "$0" "ESR" |
michael@0 | 584 | ${Else} |
michael@0 | 585 | ${WriteRegDWORD2} $TmpVal "$0" "ESR" 1 0 |
michael@0 | 586 | ${EndIf} |
michael@0 | 587 | |
michael@0 | 588 | StrCpy $0 "Software\Mozilla\${BrandFullNameInternal} ${AppVersion}$3\bin" |
michael@0 | 589 | ${WriteRegStr2} $TmpVal "$0" "PathToExe" "$8\${FileMainEXE}" 0 |
michael@0 | 590 | |
michael@0 | 591 | StrCpy $0 "Software\Mozilla\${BrandFullNameInternal} ${AppVersion}$3\extensions" |
michael@0 | 592 | ${WriteRegStr2} $TmpVal "$0" "Components" "$8\components" 0 |
michael@0 | 593 | ${WriteRegStr2} $TmpVal "$0" "Plugins" "$8\plugins" 0 |
michael@0 | 594 | |
michael@0 | 595 | StrCpy $0 "Software\Mozilla\${BrandFullNameInternal} ${AppVersion}$3" |
michael@0 | 596 | ${WriteRegStr2} $TmpVal "$0" "GeckoVer" "${GREVersion}" 0 |
michael@0 | 597 | ${If} "$3" == "" |
michael@0 | 598 | DeleteRegValue SHCTX "$0" "ESR" |
michael@0 | 599 | ${Else} |
michael@0 | 600 | ${WriteRegDWORD2} $TmpVal "$0" "ESR" 1 0 |
michael@0 | 601 | ${EndIf} |
michael@0 | 602 | |
michael@0 | 603 | StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}$3" |
michael@0 | 604 | ${WriteRegStr2} $TmpVal "$0" "" "${GREVersion}" 0 |
michael@0 | 605 | ${WriteRegStr2} $TmpVal "$0" "CurrentVersion" "${AppVersion}$3 (${ARCH} ${AB_CD})" 0 |
michael@0 | 606 | !macroend |
michael@0 | 607 | !define SetAppKeys "!insertmacro SetAppKeys" |
michael@0 | 608 | |
michael@0 | 609 | ; Add uninstall registry entries. This macro tests for write access to determine |
michael@0 | 610 | ; if the uninstall keys should be added to HKLM or HKCU. |
michael@0 | 611 | !macro SetUninstallKeys |
michael@0 | 612 | ; Check if this is an ESR release and if so add registry values so it is |
michael@0 | 613 | ; possible to determine that this is an ESR install (bug 726781). |
michael@0 | 614 | ClearErrors |
michael@0 | 615 | ${WordFind} "${UpdateChannel}" "esr" "E#" $3 |
michael@0 | 616 | ${If} ${Errors} |
michael@0 | 617 | StrCpy $3 "" |
michael@0 | 618 | ${Else} |
michael@0 | 619 | StrCpy $3 " ESR" |
michael@0 | 620 | ${EndIf} |
michael@0 | 621 | |
michael@0 | 622 | StrCpy $0 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${BrandFullNameInternal} ${AppVersion}$3 (${ARCH} ${AB_CD})" |
michael@0 | 623 | |
michael@0 | 624 | StrCpy $2 "" |
michael@0 | 625 | ClearErrors |
michael@0 | 626 | WriteRegStr HKLM "$0" "${BrandShortName}InstallerTest" "Write Test" |
michael@0 | 627 | ${If} ${Errors} |
michael@0 | 628 | ; If the uninstall keys already exist in HKLM don't create them in HKCU |
michael@0 | 629 | ClearErrors |
michael@0 | 630 | ReadRegStr $2 "HKLM" $0 "DisplayName" |
michael@0 | 631 | ${If} $2 == "" |
michael@0 | 632 | ; Otherwise we don't have any keys for this product in HKLM so proceeed |
michael@0 | 633 | ; to create them in HKCU. Better handling for this will be done in: |
michael@0 | 634 | ; Bug 711044 - Better handling for 2 uninstall icons |
michael@0 | 635 | StrCpy $1 "HKCU" |
michael@0 | 636 | SetShellVarContext current ; Set SHCTX to the current user (e.g. HKCU) |
michael@0 | 637 | ${EndIf} |
michael@0 | 638 | ClearErrors |
michael@0 | 639 | ${Else} |
michael@0 | 640 | StrCpy $1 "HKLM" |
michael@0 | 641 | SetShellVarContext all ; Set SHCTX to all users (e.g. HKLM) |
michael@0 | 642 | DeleteRegValue HKLM "$0" "${BrandShortName}InstallerTest" |
michael@0 | 643 | ${EndIf} |
michael@0 | 644 | |
michael@0 | 645 | ${If} $2 == "" |
michael@0 | 646 | ${GetLongPath} "$INSTDIR" $8 |
michael@0 | 647 | |
michael@0 | 648 | ; Write the uninstall registry keys |
michael@0 | 649 | ${WriteRegStr2} $1 "$0" "Comments" "${BrandFullNameInternal} ${AppVersion}$3 (${ARCH} ${AB_CD})" 0 |
michael@0 | 650 | ${WriteRegStr2} $1 "$0" "DisplayIcon" "$8\${FileMainEXE},0" 0 |
michael@0 | 651 | ${WriteRegStr2} $1 "$0" "DisplayName" "${BrandFullNameInternal} ${AppVersion}$3 (${ARCH} ${AB_CD})" 0 |
michael@0 | 652 | ${WriteRegStr2} $1 "$0" "DisplayVersion" "${AppVersion}" 0 |
michael@0 | 653 | ${WriteRegStr2} $1 "$0" "HelpLink" "${HelpLink}" 0 |
michael@0 | 654 | ${WriteRegStr2} $1 "$0" "InstallLocation" "$8" 0 |
michael@0 | 655 | ${WriteRegStr2} $1 "$0" "Publisher" "Mozilla" 0 |
michael@0 | 656 | ${WriteRegStr2} $1 "$0" "UninstallString" "$\"$8\uninstall\helper.exe$\"" 0 |
michael@0 | 657 | DeleteRegValue SHCTX "$0" "URLInfoAbout" |
michael@0 | 658 | ; Don't add URLUpdateInfo which is the release notes url except for the release |
michael@0 | 659 | ; and esr channels since nightly, aurora, and beta do not have release notes. |
michael@0 | 660 | ; Note: URLUpdateInfo is only defined in the official branding.nsi. |
michael@0 | 661 | !ifdef URLUpdateInfo |
michael@0 | 662 | !ifndef BETA_UPDATE_CHANNEL |
michael@0 | 663 | ${WriteRegStr2} $1 "$0" "URLUpdateInfo" "${URLUpdateInfo}" 0 |
michael@0 | 664 | !endif |
michael@0 | 665 | !endif |
michael@0 | 666 | ${WriteRegStr2} $1 "$0" "URLInfoAbout" "${URLInfoAbout}" 0 |
michael@0 | 667 | ${WriteRegDWORD2} $1 "$0" "NoModify" 1 0 |
michael@0 | 668 | ${WriteRegDWORD2} $1 "$0" "NoRepair" 1 0 |
michael@0 | 669 | |
michael@0 | 670 | ${GetSize} "$8" "/S=0K" $R2 $R3 $R4 |
michael@0 | 671 | ${WriteRegDWORD2} $1 "$0" "EstimatedSize" $R2 0 |
michael@0 | 672 | |
michael@0 | 673 | ${If} "$TmpVal" == "HKLM" |
michael@0 | 674 | SetShellVarContext all ; Set SHCTX to all users (e.g. HKLM) |
michael@0 | 675 | ${Else} |
michael@0 | 676 | SetShellVarContext current ; Set SHCTX to the current user (e.g. HKCU) |
michael@0 | 677 | ${EndIf} |
michael@0 | 678 | ${EndIf} |
michael@0 | 679 | !macroend |
michael@0 | 680 | !define SetUninstallKeys "!insertmacro SetUninstallKeys" |
michael@0 | 681 | |
michael@0 | 682 | ; Due to a bug when associating some file handlers, only SHCTX was checked for |
michael@0 | 683 | ; some file types such as ".pdf". SHCTX is set to HKCU or HKLM depending on |
michael@0 | 684 | ; whether the installer has write access to HKLM. The bug would happen when |
michael@0 | 685 | ; HCKU was checked and didn't exist since programs aren't required to set the |
michael@0 | 686 | ; HKCU Software\Classes keys when associating handlers. The fix uses the merged |
michael@0 | 687 | ; view in HKCR to check for existance of an existing association. This macro |
michael@0 | 688 | ; cleans affected installations by removing the HKLM and HKCU value if it is set |
michael@0 | 689 | ; to FirefoxHTML when there is a value for PersistentHandler or by removing the |
michael@0 | 690 | ; HKCU value when the HKLM value has a value other than an empty string. |
michael@0 | 691 | !macro FixBadFileAssociation FILE_TYPE |
michael@0 | 692 | ; Only delete the default value in case the key has values for OpenWithList, |
michael@0 | 693 | ; OpenWithProgids, PersistentHandler, etc. |
michael@0 | 694 | ReadRegStr $0 HKCU "Software\Classes\${FILE_TYPE}" "" |
michael@0 | 695 | ReadRegStr $1 HKLM "Software\Classes\${FILE_TYPE}" "" |
michael@0 | 696 | ReadRegStr $2 HKCR "${FILE_TYPE}\PersistentHandler" "" |
michael@0 | 697 | ${If} "$2" != "" |
michael@0 | 698 | ; Since there is a persistent handler remove FirefoxHTML as the default |
michael@0 | 699 | ; value from both HKCU and HKLM if it set to FirefoxHTML. |
michael@0 | 700 | ${If} "$0" == "FirefoxHTML" |
michael@0 | 701 | DeleteRegValue HKCU "Software\Classes\${FILE_TYPE}" "" |
michael@0 | 702 | ${EndIf} |
michael@0 | 703 | ${If} "$1" == "FirefoxHTML" |
michael@0 | 704 | DeleteRegValue HKLM "Software\Classes\${FILE_TYPE}" "" |
michael@0 | 705 | ${EndIf} |
michael@0 | 706 | ${ElseIf} "$0" == "FirefoxHTML" |
michael@0 | 707 | ; Since KHCU is set to FirefoxHTML remove FirefoxHTML as the default value |
michael@0 | 708 | ; from HKCU if HKLM is set to a value other than an empty string. |
michael@0 | 709 | ${If} "$1" != "" |
michael@0 | 710 | DeleteRegValue HKCU "Software\Classes\${FILE_TYPE}" "" |
michael@0 | 711 | ${EndIf} |
michael@0 | 712 | ${EndIf} |
michael@0 | 713 | !macroend |
michael@0 | 714 | !define FixBadFileAssociation "!insertmacro FixBadFileAssociation" |
michael@0 | 715 | |
michael@0 | 716 | ; Add app specific handler registry entries under Software\Classes if they |
michael@0 | 717 | ; don't exist (does not use SHCTX). |
michael@0 | 718 | !macro FixClassKeys |
michael@0 | 719 | StrCpy $1 "SOFTWARE\Classes" |
michael@0 | 720 | |
michael@0 | 721 | ; File handler keys and name value pairs that may need to be created during |
michael@0 | 722 | ; install or upgrade. |
michael@0 | 723 | ReadRegStr $0 HKCR ".shtml" "Content Type" |
michael@0 | 724 | ${If} "$0" == "" |
michael@0 | 725 | StrCpy $0 "$1\.shtml" |
michael@0 | 726 | ${WriteRegStr2} $TmpVal "$1\.shtml" "" "shtmlfile" 0 |
michael@0 | 727 | ${WriteRegStr2} $TmpVal "$1\.shtml" "Content Type" "text/html" 0 |
michael@0 | 728 | ${WriteRegStr2} $TmpVal "$1\.shtml" "PerceivedType" "text" 0 |
michael@0 | 729 | ${EndIf} |
michael@0 | 730 | |
michael@0 | 731 | ReadRegStr $0 HKCR ".xht" "Content Type" |
michael@0 | 732 | ${If} "$0" == "" |
michael@0 | 733 | ${WriteRegStr2} $TmpVal "$1\.xht" "" "xhtfile" 0 |
michael@0 | 734 | ${WriteRegStr2} $TmpVal "$1\.xht" "Content Type" "application/xhtml+xml" 0 |
michael@0 | 735 | ${EndIf} |
michael@0 | 736 | |
michael@0 | 737 | ReadRegStr $0 HKCR ".xhtml" "Content Type" |
michael@0 | 738 | ${If} "$0" == "" |
michael@0 | 739 | ${WriteRegStr2} $TmpVal "$1\.xhtml" "" "xhtmlfile" 0 |
michael@0 | 740 | ${WriteRegStr2} $TmpVal "$1\.xhtml" "Content Type" "application/xhtml+xml" 0 |
michael@0 | 741 | ${EndIf} |
michael@0 | 742 | |
michael@0 | 743 | ; Remove possibly badly associated file types |
michael@0 | 744 | ${FixBadFileAssociation} ".pdf" |
michael@0 | 745 | ${FixBadFileAssociation} ".oga" |
michael@0 | 746 | ${FixBadFileAssociation} ".ogg" |
michael@0 | 747 | ${FixBadFileAssociation} ".ogv" |
michael@0 | 748 | ${FixBadFileAssociation} ".pdf" |
michael@0 | 749 | ${FixBadFileAssociation} ".webm" |
michael@0 | 750 | !macroend |
michael@0 | 751 | !define FixClassKeys "!insertmacro FixClassKeys" |
michael@0 | 752 | |
michael@0 | 753 | ; Updates protocol handlers if their registry open command value is for this |
michael@0 | 754 | ; install location (uses SHCTX). |
michael@0 | 755 | !macro UpdateProtocolHandlers |
michael@0 | 756 | ; Store the command to open the app with an url in a register for easy access. |
michael@0 | 757 | ${GetLongPath} "$INSTDIR\${FileMainEXE}" $8 |
michael@0 | 758 | StrCpy $2 "$\"$8$\" -osint -url $\"%1$\"" |
michael@0 | 759 | |
michael@0 | 760 | ; Only set the file and protocol handlers if the existing one under HKCR is |
michael@0 | 761 | ; for this install location. |
michael@0 | 762 | |
michael@0 | 763 | ${IsHandlerForInstallDir} "FirefoxHTML" $R9 |
michael@0 | 764 | ${If} "$R9" == "true" |
michael@0 | 765 | ; An empty string is used for the 5th param because FirefoxHTML is not a |
michael@0 | 766 | ; protocol handler. |
michael@0 | 767 | ${AddDisabledDDEHandlerValues} "FirefoxHTML" "$2" "$8,1" \ |
michael@0 | 768 | "${AppRegName} HTML Document" "" |
michael@0 | 769 | ${EndIf} |
michael@0 | 770 | |
michael@0 | 771 | ${IsHandlerForInstallDir} "FirefoxURL" $R9 |
michael@0 | 772 | ${If} "$R9" == "true" |
michael@0 | 773 | ${AddDisabledDDEHandlerValues} "FirefoxURL" "$2" "$8,1" \ |
michael@0 | 774 | "${AppRegName} URL" "true" |
michael@0 | 775 | ${EndIf} |
michael@0 | 776 | |
michael@0 | 777 | ; An empty string is used for the 4th & 5th params because the following |
michael@0 | 778 | ; protocol handlers already have a display name and the additional keys |
michael@0 | 779 | ; required for a protocol handler. |
michael@0 | 780 | ${IsHandlerForInstallDir} "ftp" $R9 |
michael@0 | 781 | ${If} "$R9" == "true" |
michael@0 | 782 | ${AddDisabledDDEHandlerValues} "ftp" "$2" "$8,1" "" "" |
michael@0 | 783 | ${EndIf} |
michael@0 | 784 | |
michael@0 | 785 | ${IsHandlerForInstallDir} "http" $R9 |
michael@0 | 786 | ${If} "$R9" == "true" |
michael@0 | 787 | ${AddDisabledDDEHandlerValues} "http" "$2" "$8,1" "" "" |
michael@0 | 788 | ${EndIf} |
michael@0 | 789 | |
michael@0 | 790 | ${IsHandlerForInstallDir} "https" $R9 |
michael@0 | 791 | ${If} "$R9" == "true" |
michael@0 | 792 | ${AddDisabledDDEHandlerValues} "https" "$2" "$8,1" "" "" |
michael@0 | 793 | ${EndIf} |
michael@0 | 794 | !macroend |
michael@0 | 795 | !define UpdateProtocolHandlers "!insertmacro UpdateProtocolHandlers" |
michael@0 | 796 | |
michael@0 | 797 | !ifdef MOZ_MAINTENANCE_SERVICE |
michael@0 | 798 | ; Adds maintenance service certificate keys for the install dir. |
michael@0 | 799 | ; For the cert to work, it must also be signed by a trusted cert for the user. |
michael@0 | 800 | !macro AddMaintCertKeys |
michael@0 | 801 | Push $R0 |
michael@0 | 802 | ; Allow main Mozilla cert information for updates |
michael@0 | 803 | ; This call will push the needed key on the stack |
michael@0 | 804 | ServicesHelper::PathToUniqueRegistryPath "$INSTDIR" |
michael@0 | 805 | Pop $R0 |
michael@0 | 806 | ${If} $R0 != "" |
michael@0 | 807 | ; More than one certificate can be specified in a different subfolder |
michael@0 | 808 | ; for example: $R0\1, but each individual binary can be signed |
michael@0 | 809 | ; with at most one certificate. A fallback certificate can only be used |
michael@0 | 810 | ; if the binary is replaced with a different certificate. |
michael@0 | 811 | ; We always use the 64bit registry for certs. |
michael@0 | 812 | ${If} ${RunningX64} |
michael@0 | 813 | SetRegView 64 |
michael@0 | 814 | ${EndIf} |
michael@0 | 815 | DeleteRegKey HKLM "$R0" |
michael@0 | 816 | WriteRegStr HKLM "$R0" "prefetchProcessName" "FIREFOX" |
michael@0 | 817 | WriteRegStr HKLM "$R0\0" "name" "${CERTIFICATE_NAME}" |
michael@0 | 818 | WriteRegStr HKLM "$R0\0" "issuer" "${CERTIFICATE_ISSUER}" |
michael@0 | 819 | ${If} ${RunningX64} |
michael@0 | 820 | SetRegView lastused |
michael@0 | 821 | ${EndIf} |
michael@0 | 822 | ClearErrors |
michael@0 | 823 | ${EndIf} |
michael@0 | 824 | ; Restore the previously used value back |
michael@0 | 825 | Pop $R0 |
michael@0 | 826 | !macroend |
michael@0 | 827 | !define AddMaintCertKeys "!insertmacro AddMaintCertKeys" |
michael@0 | 828 | !endif |
michael@0 | 829 | |
michael@0 | 830 | ; Removes various registry entries for reasons noted below (does not use SHCTX). |
michael@0 | 831 | !macro RemoveDeprecatedKeys |
michael@0 | 832 | StrCpy $0 "SOFTWARE\Classes" |
michael@0 | 833 | ; Remove support for launching gopher urls from the shell during install or |
michael@0 | 834 | ; update if the DefaultIcon is from firefox.exe. |
michael@0 | 835 | ${RegCleanAppHandler} "gopher" |
michael@0 | 836 | |
michael@0 | 837 | ; Remove support for launching chrome urls from the shell during install or |
michael@0 | 838 | ; update if the DefaultIcon is from firefox.exe (Bug 301073). |
michael@0 | 839 | ${RegCleanAppHandler} "chrome" |
michael@0 | 840 | |
michael@0 | 841 | ; Remove protocol handler registry keys added by the MS shim |
michael@0 | 842 | DeleteRegKey HKLM "Software\Classes\Firefox.URL" |
michael@0 | 843 | DeleteRegKey HKCU "Software\Classes\Firefox.URL" |
michael@0 | 844 | |
michael@0 | 845 | ; Delete gopher from Capabilities\URLAssociations if it is present. |
michael@0 | 846 | ${StrFilter} "${FileMainEXE}" "+" "" "" $R9 |
michael@0 | 847 | StrCpy $0 "Software\Clients\StartMenuInternet\$R9" |
michael@0 | 848 | ClearErrors |
michael@0 | 849 | ReadRegStr $2 HKLM "$0\Capabilities\URLAssociations" "gopher" |
michael@0 | 850 | ${Unless} ${Errors} |
michael@0 | 851 | DeleteRegValue HKLM "$0\Capabilities\URLAssociations" "gopher" |
michael@0 | 852 | ${EndUnless} |
michael@0 | 853 | |
michael@0 | 854 | ; Delete gopher from the user's UrlAssociations if it points to FirefoxURL. |
michael@0 | 855 | StrCpy $0 "Software\Microsoft\Windows\Shell\Associations\UrlAssociations\gopher" |
michael@0 | 856 | ReadRegStr $2 HKCU "$0\UserChoice" "Progid" |
michael@0 | 857 | ${If} "$2" == "FirefoxURL" |
michael@0 | 858 | DeleteRegKey HKCU "$0" |
michael@0 | 859 | ${EndIf} |
michael@0 | 860 | !macroend |
michael@0 | 861 | !define RemoveDeprecatedKeys "!insertmacro RemoveDeprecatedKeys" |
michael@0 | 862 | |
michael@0 | 863 | ; Resets Win8+ specific toast keys Windows sets. We call this on a |
michael@0 | 864 | ; fresh install and on uninstall. |
michael@0 | 865 | !macro ResetWin8PromptKeys KEY PREFIX |
michael@0 | 866 | ${If} ${AtLeastWin8} |
michael@0 | 867 | DeleteRegValue ${KEY} "${PREFIX}Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" "FirefoxHTML_.htm" |
michael@0 | 868 | DeleteRegValue ${KEY} "${PREFIX}Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" "FirefoxHTML_.html" |
michael@0 | 869 | DeleteRegValue ${KEY} "${PREFIX}Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" "FirefoxHTML_.xht" |
michael@0 | 870 | DeleteRegValue ${KEY} "${PREFIX}Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" "FirefoxHTML_.xhtml" |
michael@0 | 871 | DeleteRegValue ${KEY} "${PREFIX}Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" "FirefoxHTML_.shtml" |
michael@0 | 872 | DeleteRegValue ${KEY} "${PREFIX}Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" "FirefoxURL_ftp" |
michael@0 | 873 | DeleteRegValue ${KEY} "${PREFIX}Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" "FirefoxURL_http" |
michael@0 | 874 | DeleteRegValue ${KEY} "${PREFIX}Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" "FirefoxURL_https" |
michael@0 | 875 | ${EndIf} |
michael@0 | 876 | !macroend |
michael@0 | 877 | !define ResetWin8PromptKeys "!insertmacro ResetWin8PromptKeys" |
michael@0 | 878 | |
michael@0 | 879 | !ifdef MOZ_METRO |
michael@0 | 880 | ; Resets Win8+ Metro specific splash screen info. Relies |
michael@0 | 881 | ; on AppUserModelID. |
michael@0 | 882 | !macro ResetWin8MetroSplash |
michael@0 | 883 | ${If} ${AtLeastWin8} |
michael@0 | 884 | ${AndIf} "$AppUserModelID" != "" |
michael@0 | 885 | DeleteRegKey HKCR "Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\DefaultBrowser_NOPUBLISHERID\SplashScreen\DefaultBrowser_NOPUBLISHERID!$AppUserModelID" |
michael@0 | 886 | ${EndIf} |
michael@0 | 887 | !macroend |
michael@0 | 888 | !define ResetWin8MetroSplash "!insertmacro ResetWin8MetroSplash" |
michael@0 | 889 | !endif |
michael@0 | 890 | |
michael@0 | 891 | ; Adds SE_RESTORE_NAME privs |
michael@0 | 892 | !macro AcquireSERestoreName |
michael@0 | 893 | StrCpy $R1 0 |
michael@0 | 894 | |
michael@0 | 895 | System::Call "kernel32::GetCurrentProcess() i .R0" |
michael@0 | 896 | System::Call "advapi32::OpenProcessToken(i R0, i ${TOKEN_QUERY}|${TOKEN_ADJUST_PRIVILEGES}, \ |
michael@0 | 897 | *i R1R1) i .R0" |
michael@0 | 898 | ${If} $R0 != 0 |
michael@0 | 899 | System::Call "advapi32::LookupPrivilegeValue(t n, t '${SE_RESTORE_NAME}', *l .R2) i .R0" |
michael@0 | 900 | ${If} $R0 != 0 |
michael@0 | 901 | System::Call "*(i 1, l R2, i ${SE_PRIVILEGE_ENABLED}) i .R0" |
michael@0 | 902 | System::Call "advapi32::AdjustTokenPrivileges(i R1, i 0, i R0, i 0, i 0, i 0)" |
michael@0 | 903 | System::Free $R0 |
michael@0 | 904 | ${EndIf} |
michael@0 | 905 | System::Call "kernel32::CloseHandle(i R1)" |
michael@0 | 906 | ${EndIf} |
michael@0 | 907 | !macroend |
michael@0 | 908 | !define AcquireSERestoreName "!insertmacro AcquireSERestoreName" |
michael@0 | 909 | !define un.AcquireSERestoreName "!insertmacro AcquireSERestoreName" |
michael@0 | 910 | |
michael@0 | 911 | ; Mounts all user ntuser.dat files into the registry as a subkey of HKU |
michael@0 | 912 | !macro MountRegistryIntoHKU |
michael@0 | 913 | ; $0 is used as an index for HKEY_USERS enumeration |
michael@0 | 914 | StrCpy $0 0 |
michael@0 | 915 | ${Do} |
michael@0 | 916 | EnumRegKey $1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0 |
michael@0 | 917 | ${If} $1 == "" |
michael@0 | 918 | ${Break} |
michael@0 | 919 | ${EndIf} |
michael@0 | 920 | ReadRegStr $2 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath" |
michael@0 | 921 | System::Call "advapi32::RegLoadKey(i ${HKEY_USERS}, t 'User-$0', t '$2\ntuser.dat')" |
michael@0 | 922 | System::Call "advapi32::RegLoadKey(i ${HKEY_USERS}, t 'User-$0_Classes', t '$2\AppData\Local\Microsoft\Windows\UsrClass.dat')" |
michael@0 | 923 | IntOp $0 $0 + 1 |
michael@0 | 924 | ${Loop} |
michael@0 | 925 | !macroend |
michael@0 | 926 | !define MountRegistryIntoHKU "!insertmacro MountRegistryIntoHKU" |
michael@0 | 927 | !define un.MountRegistryIntoHKU "!insertmacro MountRegistryIntoHKU" |
michael@0 | 928 | ; |
michael@0 | 929 | ; Unmounts all user ntuser.dat files into the registry as a subkey of HKU |
michael@0 | 930 | !macro UnmountRegistryIntoHKU |
michael@0 | 931 | ; $0 is used as an index for HKEY_USERS enumeration |
michael@0 | 932 | StrCpy $0 0 |
michael@0 | 933 | ${Do} |
michael@0 | 934 | EnumRegKey $1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0 |
michael@0 | 935 | ${If} $1 == "" |
michael@0 | 936 | ${Break} |
michael@0 | 937 | ${EndIf} |
michael@0 | 938 | ReadRegStr $2 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath" |
michael@0 | 939 | System::Call "advapi32::RegUnLoadKey(i ${HKEY_USERS}, t 'User-$0')" |
michael@0 | 940 | System::Call "advapi32::RegUnLoadKey(i ${HKEY_USERS}, t 'User-$0_Classes')" |
michael@0 | 941 | IntOp $0 $0 + 1 |
michael@0 | 942 | ${Loop} |
michael@0 | 943 | !macroend |
michael@0 | 944 | !define UnmountRegistryIntoHKU "!insertmacro UnmountRegistryIntoHKU" |
michael@0 | 945 | !define un.UnmountRegistryIntoHKU "!insertmacro UnmountRegistryIntoHKU" |
michael@0 | 946 | |
michael@0 | 947 | ; Unconditionally removes the delegate execute handler registration used to |
michael@0 | 948 | ; launch the metro browser and misc. metro related registry values. |
michael@0 | 949 | !macro RemoveDEHRegistration DELEGATE_EXECUTE_HANDLER_ID \ |
michael@0 | 950 | APP_USER_MODEL_ID \ |
michael@0 | 951 | PROTOCOL_ACTIVATION_ID \ |
michael@0 | 952 | FILE_ACTIVATION_ID |
michael@0 | 953 | ${AcquireSERestoreName} |
michael@0 | 954 | ${MountRegistryIntoHKU} |
michael@0 | 955 | |
michael@0 | 956 | ; $0 is used as an index for HKEY_USERS enumeration |
michael@0 | 957 | StrCpy $0 0 |
michael@0 | 958 | |
michael@0 | 959 | ${Do} |
michael@0 | 960 | EnumRegKey $1 HKU "" $0 |
michael@0 | 961 | ${If} $1 == "" |
michael@0 | 962 | ${Break} |
michael@0 | 963 | ${EndIf} |
michael@0 | 964 | |
michael@0 | 965 | ClearErrors |
michael@0 | 966 | ${WordFind} "$1" "_Classes" "E#" $3 |
michael@0 | 967 | ${Unless} ${Errors} |
michael@0 | 968 | ; remove the app user model id root registration. We don't need this |
michael@0 | 969 | ; here anymore, we just use it for tray registrationdown in widget, |
michael@0 | 970 | ; which we read out of the mozilla keys. |
michael@0 | 971 | ${If} "${APP_USER_MODEL_ID}" != "" |
michael@0 | 972 | ; The removal of this key intermittently fails, so do the best we can in cleanup |
michael@0 | 973 | DeleteRegValue HKU "$1\${APP_USER_MODEL_ID}\.exe\shell\open\command" "DelegateExecute" |
michael@0 | 974 | DeleteRegKey HKU "$1\${APP_USER_MODEL_ID}\.exe\shell\open" |
michael@0 | 975 | DeleteRegKey HKU "$1\${APP_USER_MODEL_ID}\.exe\shell" |
michael@0 | 976 | DeleteRegKey HKU "$1\${APP_USER_MODEL_ID}\.exe" |
michael@0 | 977 | DeleteRegKey HKU "$1\\${APP_USER_MODEL_ID}" |
michael@0 | 978 | ${EndIf} |
michael@0 | 979 | ; |
michael@0 | 980 | ; Remove delegate execute handler clsid registration |
michael@0 | 981 | DeleteRegKey HKU "$1\CLSID\${DELEGATE_EXECUTE_HANDLER_ID}" |
michael@0 | 982 | |
michael@0 | 983 | ; Remove protocol and file delegate execute handler id assoc |
michael@0 | 984 | DeleteRegValue HKU "$1\${PROTOCOL_ACTIVATION_ID}" "AppUserModelID" |
michael@0 | 985 | DeleteRegValue HKU "$1\${FILE_ACTIVATION_ID}" "AppUserModelID" |
michael@0 | 986 | |
michael@0 | 987 | ; Remove delegate execute application registry keys |
michael@0 | 988 | DeleteRegKey HKU "$1\${PROTOCOL_ACTIVATION_ID}\Application" |
michael@0 | 989 | DeleteRegKey HKU "$1\${FILE_ACTIVATION_ID}\Application" |
michael@0 | 990 | |
michael@0 | 991 | ; Remove misc. shell open info |
michael@0 | 992 | DeleteRegValue HKU "$1\${PROTOCOL_ACTIVATION_ID}\shell\open" "CommandId" |
michael@0 | 993 | DeleteRegValue HKU "$1\${FILE_ACTIVATION_ID}\shell\open" "CommandId" |
michael@0 | 994 | DeleteRegValue HKU "$1\${PROTOCOL_ACTIVATION_ID}\shell\open\command" "DelegateExecute" |
michael@0 | 995 | DeleteRegValue HKU "$1\${FILE_ACTIVATION_ID}\shell\open\command" "DelegateExecute" |
michael@0 | 996 | |
michael@0 | 997 | ; remove metro browser splash image data |
michael@0 | 998 | DeleteRegKey HKU "$1\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\DefaultBrowser_NOPUBLISHERID\SplashScreen\DefaultBrowser_NOPUBLISHERID!${APP_USER_MODEL_ID}" |
michael@0 | 999 | ${Else} |
michael@0 | 1000 | ; misc. Metro keys |
michael@0 | 1001 | DeleteRegKey HKU "$1\Software\Mozilla\Firefox\Metro" |
michael@0 | 1002 | DeleteRegValue HKU "$1\Software\Mozilla\Firefox" "CEHDump" |
michael@0 | 1003 | DeleteRegValue HKU "$1\Software\Mozilla\Firefox" "MetroD3DAvailable" |
michael@0 | 1004 | DeleteRegValue HKU "$1\Software\Mozilla\Firefox" "MetroLastAHE" |
michael@0 | 1005 | ${ResetWin8PromptKeys} "HKU" "$1\" |
michael@0 | 1006 | ${EndIf} |
michael@0 | 1007 | IntOp $0 $0 + 1 |
michael@0 | 1008 | ${Loop} |
michael@0 | 1009 | ${UnmountRegistryIntoHKU} |
michael@0 | 1010 | |
michael@0 | 1011 | ; The removal of this key intermittently fails, so do the best we can in cleanup |
michael@0 | 1012 | ${If} "${APP_USER_MODEL_ID}" != "" |
michael@0 | 1013 | DeleteRegValue HKLM "Software\Classes\${APP_USER_MODEL_ID}\.exe\shell\open\command" "DelegateExecute" |
michael@0 | 1014 | DeleteRegKey HKLM "Software\Classes\${APP_USER_MODEL_ID}\.exe\shell\open" |
michael@0 | 1015 | DeleteRegKey HKLM "Software\Classes\${APP_USER_MODEL_ID}\.exe\shell" |
michael@0 | 1016 | DeleteRegKey HKLM "Software\Classes\${APP_USER_MODEL_ID}\.exe" |
michael@0 | 1017 | DeleteRegKey HKLM "Software\Classes\${APP_USER_MODEL_ID}" |
michael@0 | 1018 | ${EndIf} |
michael@0 | 1019 | |
michael@0 | 1020 | ; Remove HKLM entries |
michael@0 | 1021 | DeleteRegKey HKLM "Software\Classes\CLSID\${DELEGATE_EXECUTE_HANDLER_ID}" |
michael@0 | 1022 | DeleteRegKey HKLM "Software\Classes\${PROTOCOL_ACTIVATION_ID}\Application" |
michael@0 | 1023 | DeleteRegKey HKLM "Software\Classes\${FILE_ACTIVATION_ID}\Application" |
michael@0 | 1024 | DeleteRegValue HKLM "Software\Classes\${PROTOCOL_ACTIVATION_ID}\shell\open\command" "DelegateExecute" |
michael@0 | 1025 | DeleteRegValue HKLM "Software\Classes\${FILE_ACTIVATION_ID}\shell\open\command" "DelegateExecute" |
michael@0 | 1026 | DeleteRegValue HKLM "Software\Classes\${PROTOCOL_ACTIVATION_ID}" "AppUserModelID" |
michael@0 | 1027 | DeleteRegValue HKLM "Software\Classes\${FILE_ACTIVATION_ID}" "AppUserModelID" |
michael@0 | 1028 | DeleteRegValue HKLM "Software\Classes\${PROTOCOL_ACTIVATION_ID}\shell\open" "CommandId" |
michael@0 | 1029 | DeleteRegValue HKLM "Software\Classes\${FILE_ACTIVATION_ID}\shell\open" "CommandId" |
michael@0 | 1030 | |
michael@0 | 1031 | ClearErrors |
michael@0 | 1032 | !macroend |
michael@0 | 1033 | |
michael@0 | 1034 | !define RemoveDEHRegistration "!insertmacro RemoveDEHRegistration" |
michael@0 | 1035 | !define un.RemoveDEHRegistration "!insertmacro RemoveDEHRegistration" |
michael@0 | 1036 | |
michael@0 | 1037 | ; Removes various directories and files for reasons noted below. |
michael@0 | 1038 | !macro RemoveDeprecatedFiles |
michael@0 | 1039 | ; Some users are ending up with unpacked chrome instead of omni.ja. This |
michael@0 | 1040 | ; causes Firefox to break badly after upgrading from Firefox 31, see bug |
michael@0 | 1041 | ; 1063052. Removing the chrome.manifest from the install directory causes |
michael@0 | 1042 | ; Firefox to use the updated omni.ja so it won't crash. |
michael@0 | 1043 | ${If} ${FileExists} "$INSTDIR\chrome.manifest" |
michael@0 | 1044 | Delete "$INSTDIR\chrome.manifest" |
michael@0 | 1045 | ${EndIf} |
michael@0 | 1046 | |
michael@0 | 1047 | ; Remove talkback if it is present (remove after bug 386760 is fixed) |
michael@0 | 1048 | ${If} ${FileExists} "$INSTDIR\extensions\talkback@mozilla.org" |
michael@0 | 1049 | RmDir /r /REBOOTOK "$INSTDIR\extensions\talkback@mozilla.org" |
michael@0 | 1050 | ${EndIf} |
michael@0 | 1051 | |
michael@0 | 1052 | ; Remove the Java Console extension (bug 597235) |
michael@0 | 1053 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0012-ABCDEFFEDCBA}" |
michael@0 | 1054 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0012-ABCDEFFEDCBA}" |
michael@0 | 1055 | ${EndIf} |
michael@0 | 1056 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0013-ABCDEFFEDCBA}" |
michael@0 | 1057 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0013-ABCDEFFEDCBA}" |
michael@0 | 1058 | ${EndIf} |
michael@0 | 1059 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0014-ABCDEFFEDCBA}" |
michael@0 | 1060 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0014-ABCDEFFEDCBA}" |
michael@0 | 1061 | ${EndIf} |
michael@0 | 1062 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0015-ABCDEFFEDCBA}" |
michael@0 | 1063 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0015-ABCDEFFEDCBA}" |
michael@0 | 1064 | ${EndIf} |
michael@0 | 1065 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0016-ABCDEFFEDCBA}" |
michael@0 | 1066 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0016-ABCDEFFEDCBA}" |
michael@0 | 1067 | ${EndIf} |
michael@0 | 1068 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0017-ABCDEFFEDCBA}" |
michael@0 | 1069 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0017-ABCDEFFEDCBA}" |
michael@0 | 1070 | ${EndIf} |
michael@0 | 1071 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0018-ABCDEFFEDCBA}" |
michael@0 | 1072 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0018-ABCDEFFEDCBA}" |
michael@0 | 1073 | ${EndIf} |
michael@0 | 1074 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0019-ABCDEFFEDCBA}" |
michael@0 | 1075 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0019-ABCDEFFEDCBA}" |
michael@0 | 1076 | ${EndIf} |
michael@0 | 1077 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0020-ABCDEFFEDCBA}" |
michael@0 | 1078 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0020-ABCDEFFEDCBA}" |
michael@0 | 1079 | ${EndIf} |
michael@0 | 1080 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0021-ABCDEFFEDCBA}" |
michael@0 | 1081 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0021-ABCDEFFEDCBA}" |
michael@0 | 1082 | ${EndIf} |
michael@0 | 1083 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0022-ABCDEFFEDCBA}" |
michael@0 | 1084 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0022-ABCDEFFEDCBA}" |
michael@0 | 1085 | ${EndIf} |
michael@0 | 1086 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0000-ABCDEFFEDCBA}" |
michael@0 | 1087 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0000-ABCDEFFEDCBA}" |
michael@0 | 1088 | ${EndIf} |
michael@0 | 1089 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0001-ABCDEFFEDCBA}" |
michael@0 | 1090 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0001-ABCDEFFEDCBA}" |
michael@0 | 1091 | ${EndIf} |
michael@0 | 1092 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0002-ABCDEFFEDCBA}" |
michael@0 | 1093 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0002-ABCDEFFEDCBA}" |
michael@0 | 1094 | ${EndIf} |
michael@0 | 1095 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0003-ABCDEFFEDCBA}" |
michael@0 | 1096 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0003-ABCDEFFEDCBA}" |
michael@0 | 1097 | ${EndIf} |
michael@0 | 1098 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0004-ABCDEFFEDCBA}" |
michael@0 | 1099 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0004-ABCDEFFEDCBA}" |
michael@0 | 1100 | ${EndIf} |
michael@0 | 1101 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0005-ABCDEFFEDCBA}" |
michael@0 | 1102 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0005-ABCDEFFEDCBA}" |
michael@0 | 1103 | ${EndIf} |
michael@0 | 1104 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0006-ABCDEFFEDCBA}" |
michael@0 | 1105 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0006-ABCDEFFEDCBA}" |
michael@0 | 1106 | ${EndIf} |
michael@0 | 1107 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0007-ABCDEFFEDCBA}" |
michael@0 | 1108 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0007-ABCDEFFEDCBA}" |
michael@0 | 1109 | ${EndIf} |
michael@0 | 1110 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0010-ABCDEFFEDCBA}" |
michael@0 | 1111 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0010-ABCDEFFEDCBA}" |
michael@0 | 1112 | ${EndIf} |
michael@0 | 1113 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0011-ABCDEFFEDCBA}" |
michael@0 | 1114 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0011-ABCDEFFEDCBA}" |
michael@0 | 1115 | ${EndIf} |
michael@0 | 1116 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0012-ABCDEFFEDCBA}" |
michael@0 | 1117 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0012-ABCDEFFEDCBA}" |
michael@0 | 1118 | ${EndIf} |
michael@0 | 1119 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0013-ABCDEFFEDCBA}" |
michael@0 | 1120 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0013-ABCDEFFEDCBA}" |
michael@0 | 1121 | ${EndIf} |
michael@0 | 1122 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0014-ABCDEFFEDCBA}" |
michael@0 | 1123 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0014-ABCDEFFEDCBA}" |
michael@0 | 1124 | ${EndIf} |
michael@0 | 1125 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0015-ABCDEFFEDCBA}" |
michael@0 | 1126 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0015-ABCDEFFEDCBA}" |
michael@0 | 1127 | ${EndIf} |
michael@0 | 1128 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0016-ABCDEFFEDCBA}" |
michael@0 | 1129 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0016-ABCDEFFEDCBA}" |
michael@0 | 1130 | ${EndIf} |
michael@0 | 1131 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0017-ABCDEFFEDCBA}" |
michael@0 | 1132 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0017-ABCDEFFEDCBA}" |
michael@0 | 1133 | ${EndIf} |
michael@0 | 1134 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0018-ABCDEFFEDCBA}" |
michael@0 | 1135 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0018-ABCDEFFEDCBA}" |
michael@0 | 1136 | ${EndIf} |
michael@0 | 1137 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0019-ABCDEFFEDCBA}" |
michael@0 | 1138 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0019-ABCDEFFEDCBA}" |
michael@0 | 1139 | ${EndIf} |
michael@0 | 1140 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0020-ABCDEFFEDCBA}" |
michael@0 | 1141 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0020-ABCDEFFEDCBA}" |
michael@0 | 1142 | ${EndIf} |
michael@0 | 1143 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0021-ABCDEFFEDCBA}" |
michael@0 | 1144 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0021-ABCDEFFEDCBA}" |
michael@0 | 1145 | ${EndIf} |
michael@0 | 1146 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0022-ABCDEFFEDCBA}" |
michael@0 | 1147 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0022-ABCDEFFEDCBA}" |
michael@0 | 1148 | ${EndIf} |
michael@0 | 1149 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0023-ABCDEFFEDCBA}" |
michael@0 | 1150 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0023-ABCDEFFEDCBA}" |
michael@0 | 1151 | ${EndIf} |
michael@0 | 1152 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0024-ABCDEFFEDCBA}" |
michael@0 | 1153 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0024-ABCDEFFEDCBA}" |
michael@0 | 1154 | ${EndIf} |
michael@0 | 1155 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0025-ABCDEFFEDCBA}" |
michael@0 | 1156 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0025-ABCDEFFEDCBA}" |
michael@0 | 1157 | ${EndIf} |
michael@0 | 1158 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0026-ABCDEFFEDCBA}" |
michael@0 | 1159 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0026-ABCDEFFEDCBA}" |
michael@0 | 1160 | ${EndIf} |
michael@0 | 1161 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0027-ABCDEFFEDCBA}" |
michael@0 | 1162 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0027-ABCDEFFEDCBA}" |
michael@0 | 1163 | ${EndIf} |
michael@0 | 1164 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0028-ABCDEFFEDCBA}" |
michael@0 | 1165 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0028-ABCDEFFEDCBA}" |
michael@0 | 1166 | ${EndIf} |
michael@0 | 1167 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0029-ABCDEFFEDCBA}" |
michael@0 | 1168 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0029-ABCDEFFEDCBA}" |
michael@0 | 1169 | ${EndIf} |
michael@0 | 1170 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0030-ABCDEFFEDCBA}" |
michael@0 | 1171 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0030-ABCDEFFEDCBA}" |
michael@0 | 1172 | ${EndIf} |
michael@0 | 1173 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0031-ABCDEFFEDCBA}" |
michael@0 | 1174 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0031-ABCDEFFEDCBA}" |
michael@0 | 1175 | ${EndIf} |
michael@0 | 1176 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0032-ABCDEFFEDCBA}" |
michael@0 | 1177 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0032-ABCDEFFEDCBA}" |
michael@0 | 1178 | ${EndIf} |
michael@0 | 1179 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0000-ABCDEFFEDCBA}" |
michael@0 | 1180 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0000-ABCDEFFEDCBA}" |
michael@0 | 1181 | ${EndIf} |
michael@0 | 1182 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0001-ABCDEFFEDCBA}" |
michael@0 | 1183 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0001-ABCDEFFEDCBA}" |
michael@0 | 1184 | ${EndIf} |
michael@0 | 1185 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0002-ABCDEFFEDCBA}" |
michael@0 | 1186 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0002-ABCDEFFEDCBA}" |
michael@0 | 1187 | ${EndIf} |
michael@0 | 1188 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0003-ABCDEFFEDCBA}" |
michael@0 | 1189 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0003-ABCDEFFEDCBA}" |
michael@0 | 1190 | ${EndIf} |
michael@0 | 1191 | ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0004-ABCDEFFEDCBA}" |
michael@0 | 1192 | RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0004-ABCDEFFEDCBA}" |
michael@0 | 1193 | ${EndIf} |
michael@0 | 1194 | !macroend |
michael@0 | 1195 | !define RemoveDeprecatedFiles "!insertmacro RemoveDeprecatedFiles" |
michael@0 | 1196 | |
michael@0 | 1197 | ; Converts specific partner distribution.ini from ansi to utf-8 (bug 882989) |
michael@0 | 1198 | !macro FixDistributionsINI |
michael@0 | 1199 | StrCpy $1 "$INSTDIR\distribution\distribution.ini" |
michael@0 | 1200 | StrCpy $2 "$INSTDIR\distribution\utf8fix" |
michael@0 | 1201 | StrCpy $0 "0" ; Default to not attempting to fix |
michael@0 | 1202 | |
michael@0 | 1203 | ; Check if the distribution.ini settings are for a partner build that needs |
michael@0 | 1204 | ; to have its distribution.ini converted from ansi to utf-8. |
michael@0 | 1205 | ${If} ${FileExists} "$1" |
michael@0 | 1206 | ${Unless} ${FileExists} "$2" |
michael@0 | 1207 | ReadINIStr $3 "$1" "Preferences" "app.distributor" |
michael@0 | 1208 | ${If} "$3" == "yahoo" |
michael@0 | 1209 | ReadINIStr $3 "$1" "Preferences" "app.distributor.channel" |
michael@0 | 1210 | ${If} "$3" == "de" |
michael@0 | 1211 | ${OrIf} "$3" == "es" |
michael@0 | 1212 | ${OrIf} "$3" == "e1" |
michael@0 | 1213 | ${OrIf} "$3" == "mx" |
michael@0 | 1214 | StrCpy $0 "1" |
michael@0 | 1215 | ${EndIf} |
michael@0 | 1216 | ${EndIf} |
michael@0 | 1217 | ; Create the utf8fix so this only runs once |
michael@0 | 1218 | FileOpen $3 "$2" w |
michael@0 | 1219 | FileClose $3 |
michael@0 | 1220 | ${EndUnless} |
michael@0 | 1221 | ${EndIf} |
michael@0 | 1222 | |
michael@0 | 1223 | ${If} "$0" == "1" |
michael@0 | 1224 | StrCpy $0 "0" |
michael@0 | 1225 | ClearErrors |
michael@0 | 1226 | ReadINIStr $3 "$1" "Global" "version" |
michael@0 | 1227 | ${Unless} ${Errors} |
michael@0 | 1228 | StrCpy $4 "$3" 2 |
michael@0 | 1229 | ${If} "$4" == "1." |
michael@0 | 1230 | StrCpy $4 "$3" "" 2 ; Everything after "1." |
michael@0 | 1231 | ${If} $4 < 23 |
michael@0 | 1232 | StrCpy $0 "1" |
michael@0 | 1233 | ${EndIf} |
michael@0 | 1234 | ${EndIf} |
michael@0 | 1235 | ${EndUnless} |
michael@0 | 1236 | ${EndIf} |
michael@0 | 1237 | |
michael@0 | 1238 | ${If} "$0" == "1" |
michael@0 | 1239 | ClearErrors |
michael@0 | 1240 | FileOpen $3 "$1" r |
michael@0 | 1241 | ${If} ${Errors} |
michael@0 | 1242 | FileClose $3 |
michael@0 | 1243 | ${Else} |
michael@0 | 1244 | StrCpy $2 "$INSTDIR\distribution\distribution.new" |
michael@0 | 1245 | ClearErrors |
michael@0 | 1246 | FileOpen $4 "$2" w |
michael@0 | 1247 | ${If} ${Errors} |
michael@0 | 1248 | FileClose $3 |
michael@0 | 1249 | FileClose $4 |
michael@0 | 1250 | ${Else} |
michael@0 | 1251 | StrCpy $0 "0" ; Default to not replacing the original distribution.ini |
michael@0 | 1252 | ${Do} |
michael@0 | 1253 | FileReadByte $3 $5 |
michael@0 | 1254 | ${If} $5 == "" |
michael@0 | 1255 | ${Break} |
michael@0 | 1256 | ${EndIf} |
michael@0 | 1257 | ${If} $5 == 233 ; ansi é |
michael@0 | 1258 | StrCpy $0 "1" |
michael@0 | 1259 | FileWriteByte $4 195 |
michael@0 | 1260 | FileWriteByte $4 169 |
michael@0 | 1261 | ${ElseIf} $5 == 241 ; ansi ñ |
michael@0 | 1262 | StrCpy $0 "1" |
michael@0 | 1263 | FileWriteByte $4 195 |
michael@0 | 1264 | FileWriteByte $4 177 |
michael@0 | 1265 | ${ElseIf} $5 == 252 ; ansi ü |
michael@0 | 1266 | StrCpy $0 "1" |
michael@0 | 1267 | FileWriteByte $4 195 |
michael@0 | 1268 | FileWriteByte $4 188 |
michael@0 | 1269 | ${ElseIf} $5 < 128 |
michael@0 | 1270 | FileWriteByte $4 $5 |
michael@0 | 1271 | ${EndIf} |
michael@0 | 1272 | ${Loop} |
michael@0 | 1273 | FileClose $3 |
michael@0 | 1274 | FileClose $4 |
michael@0 | 1275 | ${If} "$0" == "1" |
michael@0 | 1276 | ClearErrors |
michael@0 | 1277 | Rename "$1" "$1.bak" |
michael@0 | 1278 | ${Unless} ${Errors} |
michael@0 | 1279 | Rename "$2" "$1" |
michael@0 | 1280 | Delete "$1.bak" |
michael@0 | 1281 | ${EndUnless} |
michael@0 | 1282 | ${Else} |
michael@0 | 1283 | Delete "$2" |
michael@0 | 1284 | ${EndIf} |
michael@0 | 1285 | ${EndIf} |
michael@0 | 1286 | ${EndIf} |
michael@0 | 1287 | ${EndIf} |
michael@0 | 1288 | !macroend |
michael@0 | 1289 | !define FixDistributionsINI "!insertmacro FixDistributionsINI" |
michael@0 | 1290 | |
michael@0 | 1291 | ; Adds a pinned shortcut to Task Bar on update for Windows 7 and above if this |
michael@0 | 1292 | ; macro has never been called before and the application is default (see |
michael@0 | 1293 | ; PinToTaskBar for more details). |
michael@0 | 1294 | ; Since defaults handling is handled by Windows in Win8 and later, we always |
michael@0 | 1295 | ; attempt to pin a taskbar on that OS. If Windows sets the defaults at |
michael@0 | 1296 | ; installation time, then we don't get the opportunity to run this code at |
michael@0 | 1297 | ; that time. |
michael@0 | 1298 | !macro MigrateTaskBarShortcut |
michael@0 | 1299 | ${GetShortcutsLogPath} $0 |
michael@0 | 1300 | ${If} ${FileExists} "$0" |
michael@0 | 1301 | ClearErrors |
michael@0 | 1302 | ReadINIStr $1 "$0" "TASKBAR" "Migrated" |
michael@0 | 1303 | ${If} ${Errors} |
michael@0 | 1304 | ClearErrors |
michael@0 | 1305 | WriteIniStr "$0" "TASKBAR" "Migrated" "true" |
michael@0 | 1306 | ${If} ${AtLeastWin7} |
michael@0 | 1307 | ; No need to check the default on Win8 and later |
michael@0 | 1308 | ${If} ${AtMostWin2008R2} |
michael@0 | 1309 | ; Check if the Firefox is the http handler for this user |
michael@0 | 1310 | SetShellVarContext current ; Set SHCTX to the current user |
michael@0 | 1311 | ${IsHandlerForInstallDir} "http" $R9 |
michael@0 | 1312 | ${If} $TmpVal == "HKLM" |
michael@0 | 1313 | SetShellVarContext all ; Set SHCTX to all users |
michael@0 | 1314 | ${EndIf} |
michael@0 | 1315 | ${EndIf} |
michael@0 | 1316 | ${If} "$R9" == "true" |
michael@0 | 1317 | ${OrIf} ${AtLeastWin8} |
michael@0 | 1318 | ${PinToTaskBar} |
michael@0 | 1319 | ${EndIf} |
michael@0 | 1320 | ${EndIf} |
michael@0 | 1321 | ${EndIf} |
michael@0 | 1322 | ${EndIf} |
michael@0 | 1323 | !macroend |
michael@0 | 1324 | !define MigrateTaskBarShortcut "!insertmacro MigrateTaskBarShortcut" |
michael@0 | 1325 | |
michael@0 | 1326 | ; Adds a pinned Task Bar shortcut on Windows 7 if there isn't one for the main |
michael@0 | 1327 | ; application executable already. Existing pinned shortcuts for the same |
michael@0 | 1328 | ; application model ID must be removed first to prevent breaking the pinned |
michael@0 | 1329 | ; item's lists but multiple installations with the same application model ID is |
michael@0 | 1330 | ; an edgecase. If removing existing pinned shortcuts with the same application |
michael@0 | 1331 | ; model ID removes a pinned pinned Start Menu shortcut this will also add a |
michael@0 | 1332 | ; pinned Start Menu shortcut. |
michael@0 | 1333 | !macro PinToTaskBar |
michael@0 | 1334 | ${If} ${AtLeastWin7} |
michael@0 | 1335 | StrCpy $8 "false" ; Whether a shortcut had to be created |
michael@0 | 1336 | ${IsPinnedToTaskBar} "$INSTDIR\${FileMainEXE}" $R9 |
michael@0 | 1337 | ${If} "$R9" == "false" |
michael@0 | 1338 | ; Find an existing Start Menu shortcut or create one to use for pinning |
michael@0 | 1339 | ${GetShortcutsLogPath} $0 |
michael@0 | 1340 | ${If} ${FileExists} "$0" |
michael@0 | 1341 | ClearErrors |
michael@0 | 1342 | ReadINIStr $1 "$0" "STARTMENU" "Shortcut0" |
michael@0 | 1343 | ${Unless} ${Errors} |
michael@0 | 1344 | SetShellVarContext all ; Set SHCTX to all users |
michael@0 | 1345 | ${Unless} ${FileExists} "$SMPROGRAMS\$1" |
michael@0 | 1346 | SetShellVarContext current ; Set SHCTX to the current user |
michael@0 | 1347 | ${Unless} ${FileExists} "$SMPROGRAMS\$1" |
michael@0 | 1348 | StrCpy $8 "true" |
michael@0 | 1349 | CreateShortCut "$SMPROGRAMS\$1" "$INSTDIR\${FileMainEXE}" |
michael@0 | 1350 | ${If} ${FileExists} "$SMPROGRAMS\$1" |
michael@0 | 1351 | ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\$1" \ |
michael@0 | 1352 | "$INSTDIR" |
michael@0 | 1353 | ${If} "$AppUserModelID" != "" |
michael@0 | 1354 | ApplicationID::Set "$SMPROGRAMS\$1" "$AppUserModelID" "true" |
michael@0 | 1355 | ${EndIf} |
michael@0 | 1356 | ${EndIf} |
michael@0 | 1357 | ${EndUnless} |
michael@0 | 1358 | ${EndUnless} |
michael@0 | 1359 | |
michael@0 | 1360 | ${If} ${FileExists} "$SMPROGRAMS\$1" |
michael@0 | 1361 | ; Count of Start Menu pinned shortcuts before unpinning. |
michael@0 | 1362 | ${PinnedToStartMenuLnkCount} $R9 |
michael@0 | 1363 | |
michael@0 | 1364 | ; Having multiple shortcuts pointing to different installations with |
michael@0 | 1365 | ; the same AppUserModelID (e.g. side by side installations of the |
michael@0 | 1366 | ; same version) will make the TaskBar shortcut's lists into an bad |
michael@0 | 1367 | ; state where the lists are not shown. To prevent this first |
michael@0 | 1368 | ; uninstall the pinned item. |
michael@0 | 1369 | ApplicationID::UninstallPinnedItem "$SMPROGRAMS\$1" |
michael@0 | 1370 | |
michael@0 | 1371 | ; Count of Start Menu pinned shortcuts after unpinning. |
michael@0 | 1372 | ${PinnedToStartMenuLnkCount} $R8 |
michael@0 | 1373 | |
michael@0 | 1374 | ; If there is a change in the number of Start Menu pinned shortcuts |
michael@0 | 1375 | ; assume that unpinning unpinned a side by side installation from |
michael@0 | 1376 | ; the Start Menu and pin this installation to the Start Menu. |
michael@0 | 1377 | ${Unless} $R8 == $R9 |
michael@0 | 1378 | ; Pin the shortcut to the Start Menu. 5381 is the shell32.dll |
michael@0 | 1379 | ; resource id for the "Pin to Start Menu" string. |
michael@0 | 1380 | InvokeShellVerb::DoIt "$SMPROGRAMS" "$1" "5381" |
michael@0 | 1381 | ${EndUnless} |
michael@0 | 1382 | |
michael@0 | 1383 | ; Pin the shortcut to the TaskBar. 5386 is the shell32.dll resource |
michael@0 | 1384 | ; id for the "Pin to Taskbar" string. |
michael@0 | 1385 | InvokeShellVerb::DoIt "$SMPROGRAMS" "$1" "5386" |
michael@0 | 1386 | |
michael@0 | 1387 | ; Delete the shortcut if it was created |
michael@0 | 1388 | ${If} "$8" == "true" |
michael@0 | 1389 | Delete "$SMPROGRAMS\$1" |
michael@0 | 1390 | ${EndIf} |
michael@0 | 1391 | ${EndIf} |
michael@0 | 1392 | |
michael@0 | 1393 | ${If} $TmpVal == "HKCU" |
michael@0 | 1394 | SetShellVarContext current ; Set SHCTX to the current user |
michael@0 | 1395 | ${Else} |
michael@0 | 1396 | SetShellVarContext all ; Set SHCTX to all users |
michael@0 | 1397 | ${EndIf} |
michael@0 | 1398 | ${EndUnless} |
michael@0 | 1399 | ${EndIf} |
michael@0 | 1400 | ${EndIf} |
michael@0 | 1401 | ${EndIf} |
michael@0 | 1402 | !macroend |
michael@0 | 1403 | !define PinToTaskBar "!insertmacro PinToTaskBar" |
michael@0 | 1404 | |
michael@0 | 1405 | ; Adds a shortcut to the root of the Start Menu Programs directory if the |
michael@0 | 1406 | ; application's Start Menu Programs directory exists with a shortcut pointing to |
michael@0 | 1407 | ; this installation directory. This will also remove the old shortcuts and the |
michael@0 | 1408 | ; application's Start Menu Programs directory by calling the RemoveStartMenuDir |
michael@0 | 1409 | ; macro. |
michael@0 | 1410 | !macro MigrateStartMenuShortcut |
michael@0 | 1411 | ${GetShortcutsLogPath} $0 |
michael@0 | 1412 | ${If} ${FileExists} "$0" |
michael@0 | 1413 | ClearErrors |
michael@0 | 1414 | ReadINIStr $5 "$0" "SMPROGRAMS" "RelativePathToDir" |
michael@0 | 1415 | ${Unless} ${Errors} |
michael@0 | 1416 | ClearErrors |
michael@0 | 1417 | ReadINIStr $1 "$0" "STARTMENU" "Shortcut0" |
michael@0 | 1418 | ${If} ${Errors} |
michael@0 | 1419 | ; The STARTMENU ini section doesn't exist. |
michael@0 | 1420 | ${LogStartMenuShortcut} "${BrandFullName}.lnk" |
michael@0 | 1421 | ${GetLongPath} "$SMPROGRAMS" $2 |
michael@0 | 1422 | ${GetLongPath} "$2\$5" $1 |
michael@0 | 1423 | ${If} "$1" != "" |
michael@0 | 1424 | ClearErrors |
michael@0 | 1425 | ReadINIStr $3 "$0" "SMPROGRAMS" "Shortcut0" |
michael@0 | 1426 | ${Unless} ${Errors} |
michael@0 | 1427 | ${If} ${FileExists} "$1\$3" |
michael@0 | 1428 | ShellLink::GetShortCutTarget "$1\$3" |
michael@0 | 1429 | Pop $4 |
michael@0 | 1430 | ${If} "$INSTDIR\${FileMainEXE}" == "$4" |
michael@0 | 1431 | CreateShortCut "$SMPROGRAMS\${BrandFullName}.lnk" \ |
michael@0 | 1432 | "$INSTDIR\${FileMainEXE}" |
michael@0 | 1433 | ${If} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk" |
michael@0 | 1434 | ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandFullName}.lnk" \ |
michael@0 | 1435 | "$INSTDIR" |
michael@0 | 1436 | ${If} ${AtLeastWin7} |
michael@0 | 1437 | ${AndIf} "$AppUserModelID" != "" |
michael@0 | 1438 | ApplicationID::Set "$SMPROGRAMS\${BrandFullName}.lnk" \ |
michael@0 | 1439 | "$AppUserModelID" "true" |
michael@0 | 1440 | ${EndIf} |
michael@0 | 1441 | ${EndIf} |
michael@0 | 1442 | ${EndIf} |
michael@0 | 1443 | ${EndIf} |
michael@0 | 1444 | ${EndUnless} |
michael@0 | 1445 | ${EndIf} |
michael@0 | 1446 | ${EndIf} |
michael@0 | 1447 | ; Remove the application's Start Menu Programs directory, shortcuts, and |
michael@0 | 1448 | ; ini section. |
michael@0 | 1449 | ${RemoveStartMenuDir} |
michael@0 | 1450 | ${EndUnless} |
michael@0 | 1451 | ${EndIf} |
michael@0 | 1452 | !macroend |
michael@0 | 1453 | !define MigrateStartMenuShortcut "!insertmacro MigrateStartMenuShortcut" |
michael@0 | 1454 | |
michael@0 | 1455 | ; Removes the application's start menu directory along with its shortcuts if |
michael@0 | 1456 | ; they exist and if they exist creates a start menu shortcut in the root of the |
michael@0 | 1457 | ; start menu directory (bug 598779). If the application's start menu directory |
michael@0 | 1458 | ; is not empty after removing the shortucts the directory will not be removed |
michael@0 | 1459 | ; since these additional items were not created by the installer (uses SHCTX). |
michael@0 | 1460 | !macro RemoveStartMenuDir |
michael@0 | 1461 | ${GetShortcutsLogPath} $0 |
michael@0 | 1462 | ${If} ${FileExists} "$0" |
michael@0 | 1463 | ; Delete Start Menu Programs shortcuts, directory if it is empty, and |
michael@0 | 1464 | ; parent directories if they are empty up to but not including the start |
michael@0 | 1465 | ; menu directory. |
michael@0 | 1466 | ${GetLongPath} "$SMPROGRAMS" $1 |
michael@0 | 1467 | ClearErrors |
michael@0 | 1468 | ReadINIStr $2 "$0" "SMPROGRAMS" "RelativePathToDir" |
michael@0 | 1469 | ${Unless} ${Errors} |
michael@0 | 1470 | ${GetLongPath} "$1\$2" $2 |
michael@0 | 1471 | ${If} "$2" != "" |
michael@0 | 1472 | ; Delete shortucts in the Start Menu Programs directory. |
michael@0 | 1473 | StrCpy $3 0 |
michael@0 | 1474 | ${Do} |
michael@0 | 1475 | ClearErrors |
michael@0 | 1476 | ReadINIStr $4 "$0" "SMPROGRAMS" "Shortcut$3" |
michael@0 | 1477 | ; Stop if there are no more entries |
michael@0 | 1478 | ${If} ${Errors} |
michael@0 | 1479 | ${ExitDo} |
michael@0 | 1480 | ${EndIf} |
michael@0 | 1481 | ${If} ${FileExists} "$2\$4" |
michael@0 | 1482 | ShellLink::GetShortCutTarget "$2\$4" |
michael@0 | 1483 | Pop $5 |
michael@0 | 1484 | ${If} "$INSTDIR\${FileMainEXE}" == "$5" |
michael@0 | 1485 | Delete "$2\$4" |
michael@0 | 1486 | ${EndIf} |
michael@0 | 1487 | ${EndIf} |
michael@0 | 1488 | IntOp $3 $3 + 1 ; Increment the counter |
michael@0 | 1489 | ${Loop} |
michael@0 | 1490 | ; Delete Start Menu Programs directory and parent directories |
michael@0 | 1491 | ${Do} |
michael@0 | 1492 | ; Stop if the current directory is the start menu directory |
michael@0 | 1493 | ${If} "$1" == "$2" |
michael@0 | 1494 | ${ExitDo} |
michael@0 | 1495 | ${EndIf} |
michael@0 | 1496 | ClearErrors |
michael@0 | 1497 | RmDir "$2" |
michael@0 | 1498 | ; Stop if removing the directory failed |
michael@0 | 1499 | ${If} ${Errors} |
michael@0 | 1500 | ${ExitDo} |
michael@0 | 1501 | ${EndIf} |
michael@0 | 1502 | ${GetParent} "$2" $2 |
michael@0 | 1503 | ${Loop} |
michael@0 | 1504 | ${EndIf} |
michael@0 | 1505 | DeleteINISec "$0" "SMPROGRAMS" |
michael@0 | 1506 | ${EndUnless} |
michael@0 | 1507 | ${EndIf} |
michael@0 | 1508 | !macroend |
michael@0 | 1509 | !define RemoveStartMenuDir "!insertmacro RemoveStartMenuDir" |
michael@0 | 1510 | |
michael@0 | 1511 | ; Creates the shortcuts log ini file with the appropriate entries if it doesn't |
michael@0 | 1512 | ; already exist. |
michael@0 | 1513 | !macro CreateShortcutsLog |
michael@0 | 1514 | ${GetShortcutsLogPath} $0 |
michael@0 | 1515 | ${Unless} ${FileExists} "$0" |
michael@0 | 1516 | ${LogStartMenuShortcut} "${BrandFullName}.lnk" |
michael@0 | 1517 | ${LogQuickLaunchShortcut} "${BrandFullName}.lnk" |
michael@0 | 1518 | ${LogDesktopShortcut} "${BrandFullName}.lnk" |
michael@0 | 1519 | ${EndUnless} |
michael@0 | 1520 | !macroend |
michael@0 | 1521 | !define CreateShortcutsLog "!insertmacro CreateShortcutsLog" |
michael@0 | 1522 | |
michael@0 | 1523 | ; The files to check if they are in use during (un)install so the restart is |
michael@0 | 1524 | ; required message is displayed. All files must be located in the $INSTDIR |
michael@0 | 1525 | ; directory. |
michael@0 | 1526 | !macro PushFilesToCheck |
michael@0 | 1527 | ; The first string to be pushed onto the stack MUST be "end" to indicate |
michael@0 | 1528 | ; that there are no more files to check in $INSTDIR and the last string |
michael@0 | 1529 | ; should be ${FileMainEXE} so if it is in use the CheckForFilesInUse macro |
michael@0 | 1530 | ; returns after the first check. |
michael@0 | 1531 | Push "end" |
michael@0 | 1532 | Push "AccessibleMarshal.dll" |
michael@0 | 1533 | Push "freebl3.dll" |
michael@0 | 1534 | Push "nssckbi.dll" |
michael@0 | 1535 | Push "nspr4.dll" |
michael@0 | 1536 | Push "nssdbm3.dll" |
michael@0 | 1537 | Push "mozsqlite3.dll" |
michael@0 | 1538 | !ifdef MOZ_CONTENT_SANDBOX |
michael@0 | 1539 | Push "sandboxbroker.dll" |
michael@0 | 1540 | !endif |
michael@0 | 1541 | Push "xpcom.dll" |
michael@0 | 1542 | Push "crashreporter.exe" |
michael@0 | 1543 | Push "updater.exe" |
michael@0 | 1544 | Push "${FileMainEXE}" |
michael@0 | 1545 | !macroend |
michael@0 | 1546 | !define PushFilesToCheck "!insertmacro PushFilesToCheck" |
michael@0 | 1547 | |
michael@0 | 1548 | ; Sets this installation as the default browser by setting the registry keys |
michael@0 | 1549 | ; under HKEY_CURRENT_USER via registry calls and using the AppAssocReg NSIS |
michael@0 | 1550 | ; plugin for Vista and above. This is a function instead of a macro so it is |
michael@0 | 1551 | ; easily called from an elevated instance of the binary. Since this can be |
michael@0 | 1552 | ; called by an elevated instance logging is not performed in this function. |
michael@0 | 1553 | Function SetAsDefaultAppUserHKCU |
michael@0 | 1554 | ; Only set as the user's StartMenuInternet browser if the StartMenuInternet |
michael@0 | 1555 | ; registry keys are for this install. |
michael@0 | 1556 | ${StrFilter} "${FileMainEXE}" "+" "" "" $R9 |
michael@0 | 1557 | ClearErrors |
michael@0 | 1558 | ReadRegStr $0 HKCU "Software\Clients\StartMenuInternet\$R9\DefaultIcon" "" |
michael@0 | 1559 | ${If} ${Errors} |
michael@0 | 1560 | ${OrIf} ${AtMostWin2008R2} |
michael@0 | 1561 | ClearErrors |
michael@0 | 1562 | ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\$R9\DefaultIcon" "" |
michael@0 | 1563 | ${EndIf} |
michael@0 | 1564 | ${Unless} ${Errors} |
michael@0 | 1565 | ${GetPathFromString} "$0" $0 |
michael@0 | 1566 | ${GetParent} "$0" $0 |
michael@0 | 1567 | ${If} ${FileExists} "$0" |
michael@0 | 1568 | ${GetLongPath} "$0" $0 |
michael@0 | 1569 | ${If} "$0" == "$INSTDIR" |
michael@0 | 1570 | WriteRegStr HKCU "Software\Clients\StartMenuInternet" "" "$R9" |
michael@0 | 1571 | ${EndIf} |
michael@0 | 1572 | ${EndIf} |
michael@0 | 1573 | ${EndUnless} |
michael@0 | 1574 | |
michael@0 | 1575 | SetShellVarContext current ; Set SHCTX to the current user (e.g. HKCU) |
michael@0 | 1576 | |
michael@0 | 1577 | ${If} ${AtLeastWin8} |
michael@0 | 1578 | ${SetStartMenuInternet} "HKCU" |
michael@0 | 1579 | ${FixShellIconHandler} "HKCU" |
michael@0 | 1580 | ${FixClassKeys} ; Does not use SHCTX |
michael@0 | 1581 | Call RegisterStartMenuTile |
michael@0 | 1582 | ${EndIf} |
michael@0 | 1583 | |
michael@0 | 1584 | ${SetHandlers} |
michael@0 | 1585 | |
michael@0 | 1586 | ${If} ${AtLeastWinVista} |
michael@0 | 1587 | ; Only register as the handler on Vista and above if the app registry name |
michael@0 | 1588 | ; exists under the RegisteredApplications registry key. The protocol and |
michael@0 | 1589 | ; file handlers set previously at the user level will associate this install |
michael@0 | 1590 | ; as the default browser. |
michael@0 | 1591 | ClearErrors |
michael@0 | 1592 | ReadRegStr $0 HKLM "Software\RegisteredApplications" "${AppRegName}" |
michael@0 | 1593 | ${Unless} ${Errors} |
michael@0 | 1594 | ; This is all protected by a user choice hash in Windows 8 so it won't |
michael@0 | 1595 | ; help, but it also won't hurt. |
michael@0 | 1596 | AppAssocReg::SetAppAsDefaultAll "${AppRegName}" |
michael@0 | 1597 | ${EndUnless} |
michael@0 | 1598 | ${EndIf} |
michael@0 | 1599 | ${RemoveDeprecatedKeys} |
michael@0 | 1600 | ${PinToTaskBar} |
michael@0 | 1601 | FunctionEnd |
michael@0 | 1602 | |
michael@0 | 1603 | ; Helper for updating the shortcut application model IDs. |
michael@0 | 1604 | Function FixShortcutAppModelIDs |
michael@0 | 1605 | ${If} ${AtLeastWin7} |
michael@0 | 1606 | ${AndIf} "$AppUserModelID" != "" |
michael@0 | 1607 | ${UpdateShortcutAppModelIDs} "$INSTDIR\${FileMainEXE}" "$AppUserModelID" $0 |
michael@0 | 1608 | ${EndIf} |
michael@0 | 1609 | FunctionEnd |
michael@0 | 1610 | |
michael@0 | 1611 | ; The !ifdef NO_LOG prevents warnings when compiling the installer.nsi due to |
michael@0 | 1612 | ; this function only being used by the uninstaller.nsi. |
michael@0 | 1613 | !ifdef NO_LOG |
michael@0 | 1614 | |
michael@0 | 1615 | Function SetAsDefaultAppUser |
michael@0 | 1616 | ; On Win8, we want to avoid having a UAC prompt since we'll already have |
michael@0 | 1617 | ; another action for control panel default browser selection popping up |
michael@0 | 1618 | ; to the user. Win8 is the first OS where the start menu keys can be |
michael@0 | 1619 | ; added into HKCU. The call to SetAsDefaultAppUserHKCU will have already |
michael@0 | 1620 | ; set the HKCU keys for SetStartMenuInternet. |
michael@0 | 1621 | ${If} ${AtLeastWin8} |
michael@0 | 1622 | ; Check if this is running in an elevated process |
michael@0 | 1623 | ClearErrors |
michael@0 | 1624 | ${GetParameters} $0 |
michael@0 | 1625 | ${GetOptions} "$0" "/UAC:" $0 |
michael@0 | 1626 | ${If} ${Errors} ; Not elevated |
michael@0 | 1627 | Call SetAsDefaultAppUserHKCU |
michael@0 | 1628 | ${Else} ; Elevated - execute the function in the unelevated process |
michael@0 | 1629 | GetFunctionAddress $0 SetAsDefaultAppUserHKCU |
michael@0 | 1630 | UAC::ExecCodeSegment $0 |
michael@0 | 1631 | ${EndIf} |
michael@0 | 1632 | Return ; Nothing more needs to be done |
michael@0 | 1633 | ${EndIf} |
michael@0 | 1634 | |
michael@0 | 1635 | ; Before Win8, it is only possible to set this installation of the application |
michael@0 | 1636 | ; as the StartMenuInternet handler if it was added to the HKLM |
michael@0 | 1637 | ; StartMenuInternet registry keys. |
michael@0 | 1638 | ; http://support.microsoft.com/kb/297878 |
michael@0 | 1639 | |
michael@0 | 1640 | ; Check if this install location registered as the StartMenuInternet client |
michael@0 | 1641 | ${StrFilter} "${FileMainEXE}" "+" "" "" $R9 |
michael@0 | 1642 | ClearErrors |
michael@0 | 1643 | ReadRegStr $0 HKCU "Software\Clients\StartMenuInternet\$R9\DefaultIcon" "" |
michael@0 | 1644 | ${If} ${Errors} |
michael@0 | 1645 | ${OrIf} ${AtMostWin2008R2} |
michael@0 | 1646 | ClearErrors |
michael@0 | 1647 | ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\$R9\DefaultIcon" "" |
michael@0 | 1648 | ${EndIf} |
michael@0 | 1649 | |
michael@0 | 1650 | ${Unless} ${Errors} |
michael@0 | 1651 | ${GetPathFromString} "$0" $0 |
michael@0 | 1652 | ${GetParent} "$0" $0 |
michael@0 | 1653 | ${If} ${FileExists} "$0" |
michael@0 | 1654 | ${GetLongPath} "$0" $0 |
michael@0 | 1655 | ${If} "$0" == "$INSTDIR" |
michael@0 | 1656 | ; Check if this is running in an elevated process |
michael@0 | 1657 | ClearErrors |
michael@0 | 1658 | ${GetParameters} $0 |
michael@0 | 1659 | ${GetOptions} "$0" "/UAC:" $0 |
michael@0 | 1660 | ${If} ${Errors} ; Not elevated |
michael@0 | 1661 | Call SetAsDefaultAppUserHKCU |
michael@0 | 1662 | ${Else} ; Elevated - execute the function in the unelevated process |
michael@0 | 1663 | GetFunctionAddress $0 SetAsDefaultAppUserHKCU |
michael@0 | 1664 | UAC::ExecCodeSegment $0 |
michael@0 | 1665 | ${EndIf} |
michael@0 | 1666 | Return ; Nothing more needs to be done |
michael@0 | 1667 | ${EndIf} |
michael@0 | 1668 | ${EndIf} |
michael@0 | 1669 | ${EndUnless} |
michael@0 | 1670 | |
michael@0 | 1671 | ; The code after ElevateUAC won't be executed on Vista and above when the |
michael@0 | 1672 | ; user: |
michael@0 | 1673 | ; a) is a member of the administrators group (e.g. elevation is required) |
michael@0 | 1674 | ; b) is not a member of the administrators group and chooses to elevate |
michael@0 | 1675 | ${ElevateUAC} |
michael@0 | 1676 | |
michael@0 | 1677 | ${SetStartMenuInternet} "HKLM" |
michael@0 | 1678 | |
michael@0 | 1679 | SetShellVarContext all ; Set SHCTX to all users (e.g. HKLM) |
michael@0 | 1680 | |
michael@0 | 1681 | ${FixClassKeys} ; Does not use SHCTX |
michael@0 | 1682 | ${FixShellIconHandler} "HKLM" |
michael@0 | 1683 | ${RemoveDeprecatedKeys} ; Does not use SHCTX |
michael@0 | 1684 | |
michael@0 | 1685 | ClearErrors |
michael@0 | 1686 | ${GetParameters} $0 |
michael@0 | 1687 | ${GetOptions} "$0" "/UAC:" $0 |
michael@0 | 1688 | ${If} ${Errors} |
michael@0 | 1689 | Call SetAsDefaultAppUserHKCU |
michael@0 | 1690 | ${Else} |
michael@0 | 1691 | GetFunctionAddress $0 SetAsDefaultAppUserHKCU |
michael@0 | 1692 | UAC::ExecCodeSegment $0 |
michael@0 | 1693 | ${EndIf} |
michael@0 | 1694 | FunctionEnd |
michael@0 | 1695 | !define SetAsDefaultAppUser "Call SetAsDefaultAppUser" |
michael@0 | 1696 | |
michael@0 | 1697 | !endif ; NO_LOG |