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

@ -4,15 +4,15 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# These defines should match application.ini settings
!define AppName "Basilisk"
!define AppName "@MOZ_APP_DISPLAYNAME@"
!define AppVersion "@APP_VERSION@"
!define GREVersion @MOZILLA_VERSION@
!define AB_CD "@AB_CD@"
!define FileMainEXE "@MOZ_APP_NAME@.exe"
!define WindowClass "BasiliskMessageWindow"
!define DDEApplication "Basilisk"
!define AppRegName "Basilisk"
!define WindowClass "@MOZ_APP_DISPLAYNAME@MessageWindow"
!define DDEApplication "@MOZ_APP_DISPLAYNAME@"
!define AppRegName "${CompanyName}\${BrandShortName}"
!ifndef DEV_EDITION
!define BrandShortName "@MOZ_APP_DISPLAYNAME@"
@ -56,7 +56,7 @@ VIProductVersion "1.0.0.0"
VIAddVersionKey "ProductName" "${BrandShortName}"
VIAddVersionKey "CompanyName" "${CompanyName}"
#ifdef MOZ_OFFICIAL_BRANDING
VIAddVersionKey "LegalTrademarks" "${BrandShortName} is a Trademark of Moonchild Productions."
VIAddVersionKey "LegalTrademarks" "${BrandShortName} is a Trademark of ${CompanyName}."
#endif
VIAddVersionKey "LegalCopyright" "${CompanyName}"
VIAddVersionKey "FileVersion" "${AppVersion}"

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

View file

@ -533,7 +533,7 @@
${WriteRegStr2} $1 "$0" "DisplayVersion" "${AppVersion}" 0
${WriteRegStr2} $1 "$0" "HelpLink" "${HelpLink}" 0
${WriteRegStr2} $1 "$0" "InstallLocation" "$8" 0
${WriteRegStr2} $1 "$0" "Publisher" "Moonchild Productions" 0
${WriteRegStr2} $1 "$0" "Publisher" "${CompanyName}" 0
${WriteRegStr2} $1 "$0" "UninstallString" "$\"$8\uninstall\helper.exe$\"" 0
DeleteRegValue SHCTX "$0" "URLInfoAbout"
; Don't add URLUpdateInfo which is the release notes url except for the release

View file

@ -121,9 +121,9 @@ VIAddVersionKey "OriginalFilename" "helper.exe"
Name "${BrandFullName}"
OutFile "helper.exe"
!ifdef HAVE_64BIT_BUILD
InstallDir "$PROGRAMFILES64\${BrandFullName}\"
InstallDir "$PROGRAMFILES64\${CompanyName}\${BrandShortName}\"
!else
InstallDir "$PROGRAMFILES32\${BrandFullName}\"
InstallDir "$PROGRAMFILES32\${CompanyName}\${BrandShortName}\"
!endif
ShowUnInstDetails nevershow
@ -193,10 +193,10 @@ Section "Uninstall"
${EndIf}
; setup the application model id registration value
${un.InitHashAppModelId} "$INSTDIR" "Software\Mozilla\${AppName}\TaskBarIDs"
${un.InitHashAppModelId} "$INSTDIR" "Software\${CompanyName}\${BrandShortName}\TaskBarIDs"
SetShellVarContext current ; Set SHCTX to HKCU
${un.RegCleanMain} "Software\Mozilla"
${un.RegCleanMain} "Software\${CompanyName}"
${un.RegCleanUninstall}
${un.DeleteShortcuts}
@ -207,21 +207,21 @@ Section "Uninstall"
${EndIf}
; Remove the updates directory for Vista and above
${un.CleanUpdateDirectories} "Mozilla\Basilisk" "Mozilla\updates"
${un.CleanUpdateDirectories} "${CompanyName}\${BrandShortName}" "${CompanyName}\updates"
; Remove any app model id's stored in the registry for this install path
DeleteRegValue HKCU "Software\Mozilla\${AppName}\TaskBarIDs" "$INSTDIR"
DeleteRegValue HKLM "Software\Mozilla\${AppName}\TaskBarIDs" "$INSTDIR"
DeleteRegValue HKCU "Software\${CompanyName}\${BrandShortName}\TaskBarIDs" "$INSTDIR"
DeleteRegValue HKLM "Software\${CompanyName}\${BrandShortName}\TaskBarIDs" "$INSTDIR"
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
${un.RegCleanMain} "Software\Mozilla"
${un.RegCleanMain} "Software\${CompanyName}"
${un.RegCleanUninstall}
${un.DeleteShortcuts}
${un.SetAppLSPCategories}
@ -251,10 +251,10 @@ Section "Uninstall"
${EndIf}
SetShellVarContext all ; Set SHCTX to HKLM
${un.GetSecondInstallPath} "Software\Mozilla" $R9
${un.GetSecondInstallPath} "Software\${CompanyName}" $R9
${If} $R9 == "false"
SetShellVarContext current ; Set SHCTX to HKCU
${un.GetSecondInstallPath} "Software\Mozilla" $R9
${un.GetSecondInstallPath} "Software\${CompanyName}" $R9
${EndIf}
StrCpy $0 "Software\Clients\StartMenuInternet\${FileMainEXE}\shell\open\command"
@ -300,7 +300,7 @@ Section "Uninstall"
StrCpy $0 "Software\Microsoft\MediaPlayer\ShimInclusionList\plugin-container.exe"
DeleteRegKey HKLM "$0"
DeleteRegKey HKCU "$0"
StrCpy $0 "Software\Classes\MIME\Database\Content Type\application/x-xpinstall;app=Basilisk"
StrCpy $0 "Software\Classes\MIME\Database\Content Type\application/x-xpinstall;app=${FileMainEXE}"
DeleteRegKey HKLM "$0"
DeleteRegKey HKCU "$0"
${Else}
@ -397,7 +397,7 @@ Section "Uninstall"
; subsequently deleted after checking. If the value is found during startup
; the browser will offer to Reset Basilisk. We use the UpdateChannel to match
; uninstalls of Basilisk-release with reinstalls of Basilisk-release, for example.
WriteRegStr HKCU "Software\Mozilla\Basilisk" "Uninstalled-${UpdateChannel}" "True"
WriteRegStr HKCU "Software\${CompanyName}\${BrandShortName}" "Uninstalled-${UpdateChannel}" "True"
${un.IsFirewallSvcRunning}
Pop $0