Make branding more flexible

This commit is contained in:
K4sum1 2025-04-26 22:40:17 -07:00
commit 0f85813996
25 changed files with 89 additions and 118 deletions

View file

@ -125,9 +125,9 @@ VIAddVersionKey "OriginalFilename" "setup.exe"
Name "${BrandFullName}"
OutFile "setup.exe"
!ifdef HAVE_64BIT_BUILD
InstallDir "$PROGRAMFILES64\${BrandFullName}\"
InstallDir "$PROGRAMFILES64\${CompanyName}\${BrandShortName}\"
!else
InstallDir "$PROGRAMFILES32\${BrandFullName}\"
InstallDir "$PROGRAMFILES32\${CompanyName}\${BrandShortName}\"
!endif
ShowInstDetails nevershow
@ -246,10 +246,10 @@ Section "-InstallStartCleanup"
${EndIf}
; setup the application model id registration value
${InitHashAppModelId} "$INSTDIR" "Software\Mozilla\${AppName}\TaskBarIDs"
${InitHashAppModelId} "$INSTDIR" "Software\${CompanyName}\${BrandShortName}\TaskBarIDs"
; Remove the updates directory for Vista and above
${CleanUpdateDirectories} "Mozilla\Basilisk" "Mozilla\updates"
${CleanUpdateDirectories} "${CompanyName}\${BrandShortName}" "${CompanyName}\updates"
${RemoveDeprecatedFiles}
${RemovePrecompleteEntries} "false"
@ -339,25 +339,25 @@ Section "-Application" APP_IDX
${LogHeader} "Adding Registry Entries"
SetShellVarContext current ; Set SHCTX to HKCU
${RegCleanMain} "Software\Mozilla"
${RegCleanMain} "Software\${CompanyName}"
${RegCleanUninstall}
${UpdateProtocolHandlers}
ClearErrors
WriteRegStr HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" "Write Test"
WriteRegStr HKLM "Software\${CompanyName}" "${BrandShortName}InstallerTest" "Write Test"
${If} ${Errors}
StrCpy $TmpVal "HKCU" ; used primarily for logging
${Else}
SetShellVarContext all ; Set SHCTX to HKLM
DeleteRegValue HKLM "Software\Mozilla" "${BrandShortName}InstallerTest"
DeleteRegValue HKLM "Software\${CompanyName}" "${BrandShortName}InstallerTest"
StrCpy $TmpVal "HKLM" ; used primarily for logging
${RegCleanMain} "Software\Mozilla"
${RegCleanMain} "Software\${CompanyName}"
${RegCleanUninstall}
${UpdateProtocolHandlers}
ReadRegStr $0 HKLM "Software\mozilla.org\Mozilla" "CurrentVersion"
ReadRegStr $0 HKLM "Software\${CompanyName}\${BrandShortName}" "CurrentVersion"
${If} "$0" != "${GREVersion}"
WriteRegStr HKLM "Software\mozilla.org\Mozilla" "CurrentVersion" "${GREVersion}"
WriteRegStr HKLM "Software\${CompanyName}\${BrandShortName}" "CurrentVersion" "${GREVersion}"
${EndIf}
${EndIf}
@ -584,7 +584,7 @@ Section "-InstallEndCleanup"
; If we have something other than empty string now, write the value.
${If} "$0" != ""
ClearErrors
WriteRegStr HKCU "Software\Mozilla\Basilisk" "OldDefaultBrowserCommand" "$0"
WriteRegStr HKCU "Software\${CompanyName}\${BrandShortName}" "OldDefaultBrowserCommand" "$0"
${EndIf}
${LogHeader} "Setting as the default browser"
@ -600,7 +600,7 @@ Section "-InstallEndCleanup"
${ElseIfNot} ${Errors}
${LogHeader} "Writing default-browser opt-out"
ClearErrors
WriteRegStr HKCU "Software\Mozilla\Basilisk" "DefaultBrowserOptOut" "True"
WriteRegStr HKCU "Software\${CompanyName}\${BrandShortName}" "DefaultBrowserOptOut" "True"
${If} ${Errors}
${LogMsg} "Error writing default-browser opt-out"
${EndIf}
@ -964,9 +964,9 @@ Function preSummary
; Check if it is possible to write to HKLM
${If} $InstallType != ${INSTALLTYPE_PORTABLE}
ClearErrors
WriteRegStr HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" "Write Test"
WriteRegStr HKLM "Software\${CompanyName}" "${BrandShortName}InstallerTest" "Write Test"
${Unless} ${Errors}
DeleteRegValue HKLM "Software\Mozilla" "${BrandShortName}InstallerTest"
DeleteRegValue HKLM "Software\${CompanyName}" "${BrandShortName}InstallerTest"
; Check if Basilisk is the http handler for this user.
SetShellVarContext current ; Set SHCTX to the current user
${IsHandlerForInstallDir} "http" $R9