@@ -41,6 +41,7 @@ Var TmpVal
41
41
Var InstallType
42
42
Var AddStartMenuSC
43
43
Var AddTaskbarSC
44
+ Var AddQuickLaunchSC
44
45
Var AddDesktopSC
45
46
Var AddPrivateBrowsingSC
46
47
Var InstallMaintenanceService
@@ -381,20 +382,22 @@ Section "-Application" APP_IDX
381
382
382
383
ClearErrors
383
384
384
- ; Apply LPAC permissions to install directory.
385
- ${LogHeader} " File access permissions"
386
- Push " Marker"
387
- AccessControl::GrantOnFile \
388
- " $INSTDIR" " (${LpacFirefoxInstallFilesSid})" " GenericRead + GenericExecute"
389
- Pop $TmpVal ; get "Marker" or error msg
390
- ${If} $TmpVal == " Marker"
391
- ${LogMsg} " Granted access for LPAC to $INSTDIR"
392
- ${Else}
393
- ${LogMsg} " ** Error granting access for LPAC to $INSTDIR : $TmpVal **"
394
- Pop $TmpVal ; get "Marker"
395
- ${EndIf}
385
+ ${If} ${AtLeastWin10}
386
+ ; Apply LPAC permissions to install directory.
387
+ ${LogHeader} " File access permissions"
388
+ Push " Marker"
389
+ AccessControl::GrantOnFile \
390
+ " $INSTDIR" " (${LpacFirefoxInstallFilesSid})" " GenericRead + GenericExecute"
391
+ Pop $TmpVal ; get "Marker" or error msg
392
+ ${If} $TmpVal == " Marker"
393
+ ${LogMsg} " Granted access for LPAC to $INSTDIR"
394
+ ${Else}
395
+ ${LogMsg} " ** Error granting access for LPAC to $INSTDIR : $TmpVal **"
396
+ Pop $TmpVal ; get "Marker"
397
+ ${EndIf}
396
398
397
- ClearErrors
399
+ ClearErrors
400
+ ${EndIf}
398
401
399
402
; Default for creating Start Menu shortcut
400
403
; (1 = create, 0 = don't create)
@@ -406,6 +409,16 @@ Section "-Application" APP_IDX
406
409
StrCpy $AddPrivateBrowsingSC " 1"
407
410
${EndIf}
408
411
412
+ ; Default for creating Quick Launch shortcut (1 = create, 0 = don't create)
413
+ ${If} $AddQuickLaunchSC == " "
414
+ ; Don't install the quick launch shortcut on Windows 7
415
+ ${If} ${AtLeastWin7}
416
+ StrCpy $AddQuickLaunchSC " 0"
417
+ ${Else}
418
+ StrCpy $AddQuickLaunchSC " 1"
419
+ ${EndIf}
420
+ ${EndIf}
421
+
409
422
; Default for creating Desktop shortcut (1 = create, 0 = don't create)
410
423
${If} $AddDesktopSC == " "
411
424
StrCpy $AddDesktopSC " 1"
@@ -494,11 +507,13 @@ Section "-Application" APP_IDX
494
507
SetShellVarContext all ; Set SHCTX to HKLM
495
508
496
509
; The keys below can be set in HKCU if needed.
510
+ ; For pre win8, the following keys should only be set if we can write to HKLM.
511
+ ; For post win8, the keys below can be set in HKCU if needed.
497
512
${If} $TmpVal == " HKLM"
498
513
; Set the Start Menu Internet and Registered App HKLM registry keys.
499
514
${SetStartMenuInternet} " HKLM"
500
515
${FixShellIconHandler} " HKLM"
501
- ${Else }
516
+ ${ElseIf} ${AtLeastWin8 }
502
517
; Set the Start Menu Internet and Registered App HKCU registry keys.
503
518
${SetStartMenuInternet} " HKCU"
504
519
${FixShellIconHandler} " HKCU"
@@ -559,7 +574,9 @@ Section "-Application" APP_IDX
559
574
WriteRegDWORD HKCU ${MOZ_LAUNCHER_SUBKEY} " $INSTDIR\${FileMainEXE}|Telemetry" 1
560
575
!endif
561
576
562
- ${WriteToastNotificationRegistration} $TmpVal
577
+ ${If} ${AtLeastWin10}
578
+ ${WriteToastNotificationRegistration} $TmpVal
579
+ ${EndIf}
563
580
564
581
; Create shortcuts
565
582
${LogHeader} " Adding Shortcuts"
@@ -648,14 +665,16 @@ Section "-Application" APP_IDX
648
665
; Update lastwritetime of the Start Menu shortcut to clear the tile cache.
649
666
; Do this for both shell contexts in case the user has shortcuts in multiple
650
667
; locations, then restore the previous context at the end.
651
- SetShellVarContext all
652
- ${TouchStartMenuShortcut}
653
- SetShellVarContext current
654
- ${TouchStartMenuShortcut}
655
- ${If} $TmpVal == " HKLM"
668
+ ${If} ${AtLeastWin8}
656
669
SetShellVarContext all
657
- ${ElseIf} $TmpVal == " HKCU "
670
+ ${TouchStartMenuShortcut}
658
671
SetShellVarContext current
672
+ ${TouchStartMenuShortcut}
673
+ ${If} $TmpVal == " HKLM"
674
+ SetShellVarContext all
675
+ ${ElseIf} $TmpVal == " HKCU"
676
+ SetShellVarContext current
677
+ ${EndIf}
659
678
${EndIf}
660
679
661
680
${If} $AddDesktopSC == 1
@@ -684,6 +703,27 @@ Section "-Application" APP_IDX
684
703
${EndIf}
685
704
${EndIf}
686
705
706
+ ; If elevated the Quick Launch shortcut must be added from the unelevated
707
+ ; original process.
708
+ ${If} $AddQuickLaunchSC == 1
709
+ ${Unless} ${AtLeastWin7}
710
+ ClearErrors
711
+ ${GetParameters} $0
712
+ ${GetOptions} " $0" " /UAC:" $0
713
+ ${If} ${Errors}
714
+ Call AddQuickLaunchShortcut
715
+ ${LogMsg} " Added Shortcut: $QUICKLAUNCH\${BrandShortName}.lnk"
716
+ ${Else}
717
+ ; It is not possible to add a log entry from the unelevated process so
718
+ ; add the log entry without the path since there is no simple way to
719
+ ; know the correct full path.
720
+ ${LogMsg} " Added Quick Launch Shortcut: ${BrandShortName}.lnk"
721
+ GetFunctionAddress $0 AddQuickLaunchShortcut
722
+ UAC::ExecCodeSegment $0
723
+ ${EndIf}
724
+ ${EndUnless}
725
+ ${EndIf}
726
+
687
727
!ifdef MOZ_OPTIONAL_EXTENSIONS
688
728
${If} ${FileExists} " $INSTDIR\distribution\optional-extensions"
689
729
${LogHeader} " Installing optional extensions if requested"
@@ -970,6 +1010,14 @@ FunctionEnd
970
1010
# ###############################################################################
971
1011
# Helper Functions
972
1012
1013
+ Function AddQuickLaunchShortcut
1014
+ CreateShortCut " $QUICKLAUNCH\${BrandShortName}.lnk" " $INSTDIR\${FileMainEXE}"
1015
+ ${If} ${FileExists} " $QUICKLAUNCH\${BrandShortName}.lnk"
1016
+ ShellLink::SetShortCutWorkingDirectory " $QUICKLAUNCH\${BrandShortName}.lnk" \
1017
+ " $INSTDIR"
1018
+ ${EndIf}
1019
+ FunctionEnd
1020
+
973
1021
Function CheckExistingInstall
974
1022
; If there is a pending file copy from a previous upgrade don't allow
975
1023
; installing until after the system has rebooted.
@@ -1667,15 +1715,55 @@ Function preSummary
1667
1715
DeleteINIStr " $PLUGINSDIR\summary.ini" " Settings" NextButtonText
1668
1716
${EndIf}
1669
1717
1718
+
1719
+ ; Remove the "Field 4" ini section in case the user hits back and changes the
1720
+ ; installation directory which could change whether the make default checkbox
1721
+ ; should be displayed.
1722
+ DeleteINISec " $PLUGINSDIR\summary.ini" " Field 4"
1723
+
1724
+ ; Check if it is possible to write to HKLM
1725
+ ClearErrors
1726
+ WriteRegStr HKLM " Software\Mozilla" " ${BrandShortName}InstallerTest" " Write Test"
1727
+ ${Unless} ${Errors}
1728
+ DeleteRegValue HKLM " Software\Mozilla" " ${BrandShortName}InstallerTest"
1729
+ ; Check if Firefox is the http handler for this user.
1730
+ SetShellVarContext current ; Set SHCTX to the current user
1731
+ ${IsHandlerForInstallDir} " http" $R9
1732
+ ; If Firefox isn't the http handler for this user show the option to set
1733
+ ; Firefox as the default browser.
1734
+ ${If} " $R9" != " true"
1735
+ ${AndIf} ${AtMostWin2008R2}
1736
+ WriteINIStr " $PLUGINSDIR\summary.ini" " Settings" NumFields " 4"
1737
+ WriteINIStr " $PLUGINSDIR\summary.ini" " Field 4" Type " checkbox"
1738
+ WriteINIStr " $PLUGINSDIR\summary.ini" " Field 4" Text " $(SUMMARY_TAKE_DEFAULTS)"
1739
+ WriteINIStr " $PLUGINSDIR\summary.ini" " Field 4" Left " 0"
1740
+ WriteINIStr " $PLUGINSDIR\summary.ini" " Field 4" Right " -1"
1741
+ WriteINIStr " $PLUGINSDIR\summary.ini" " Field 4" State " 1"
1742
+ WriteINIStr " $PLUGINSDIR\summary.ini" " Field 4" Top " 32"
1743
+ WriteINIStr " $PLUGINSDIR\summary.ini" " Field 4" Bottom " 53"
1744
+ ${EndIf}
1745
+ ${EndUnless}
1746
+
1670
1747
${If} " $TmpVal" == " true"
1671
- WriteINIStr " $PLUGINSDIR\summary.ini" " Settings" NumFields " 4"
1672
-
1673
- WriteINIStr " $PLUGINSDIR\summary.ini" " Field 4" Type " label"
1674
- WriteINIStr " $PLUGINSDIR\summary.ini" " Field 4" Text " $(SUMMARY_REBOOT_REQUIRED_INSTALL)"
1675
- WriteINIStr " $PLUGINSDIR\summary.ini" " Field 4" Left " 0"
1676
- WriteINIStr " $PLUGINSDIR\summary.ini" " Field 4" Right " -1"
1677
- WriteINIStr " $PLUGINSDIR\summary.ini" " Field 4" Top " 35"
1678
- WriteINIStr " $PLUGINSDIR\summary.ini" " Field 4" Bottom " 50"
1748
+ ; If there is already a Type entry in the "Field 4" section with a value of
1749
+ ; checkbox then the set as the default browser checkbox is displayed and
1750
+ ; this text must be moved below it.
1751
+ ReadINIStr $0 " $PLUGINSDIR\summary.ini" " Field 4" " Type"
1752
+ ${If} " $0" == " checkbox"
1753
+ StrCpy $0 " 5"
1754
+ WriteINIStr " $PLUGINSDIR\summary.ini" " Field $0" Top " 53"
1755
+ WriteINIStr " $PLUGINSDIR\summary.ini" " Field $0" Bottom " 68"
1756
+ ${Else}
1757
+ StrCpy $0 " 4"
1758
+ WriteINIStr " $PLUGINSDIR\summary.ini" " Field $0" Top " 35"
1759
+ WriteINIStr " $PLUGINSDIR\summary.ini" " Field $0" Bottom " 50"
1760
+ ${EndIf}
1761
+ WriteINIStr " $PLUGINSDIR\summary.ini" " Settings" NumFields " $0"
1762
+
1763
+ WriteINIStr " $PLUGINSDIR\summary.ini" " Field $0" Type " label"
1764
+ WriteINIStr " $PLUGINSDIR\summary.ini" " Field $0" Text " $(SUMMARY_REBOOT_REQUIRED_INSTALL)"
1765
+ WriteINIStr " $PLUGINSDIR\summary.ini" " Field $0" Left " 0"
1766
+ WriteINIStr " $PLUGINSDIR\summary.ini" " Field $0" Right " -1"
1679
1767
${EndIf}
1680
1768
1681
1769
!insertmacro MUI_HEADER_TEXT " $(SUMMARY_PAGE_TITLE)" " $(SUMMARY_PAGE_SUBTITLE)"
0 commit comments