Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
basilisk-dev committed Nov 22, 2024
2 parents 43b26ae + 435329c commit d7589fa
Show file tree
Hide file tree
Showing 13 changed files with 149 additions and 227 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-basilisk-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
arch: i686

steps:
- name: List available VC Redist folders (for debugging)
run: tree /f "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\redist"

- name: Install MozillaBuild
run: |
Invoke-WebRequest -Uri https://ftp.mozilla.org/pub/mozilla/libraries/win32/MozillaBuildSetup-3.4.exe -OutFile MozillaBuildSetup-3.4.exe
Expand Down
12 changes: 0 additions & 12 deletions basilisk/components/downloads/DownloadsCommon.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -659,18 +659,6 @@ XPCOMUtils.defineLazyGetter(this.DownloadsCommon, "error", () => {
return DownloadsLogger.error.bind(DownloadsLogger);
});

/**
* Returns true if we are executing on Windows Vista or a later version.
*/
XPCOMUtils.defineLazyGetter(DownloadsCommon, "isWinVistaOrHigher", function () {
let os = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).OS;
if (os != "WINNT") {
return false;
}
let sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
return parseFloat(sysInfo.getProperty("version")) >= 6;
});

////////////////////////////////////////////////////////////////////////////////
//// DownloadsData

Expand Down
2 changes: 1 addition & 1 deletion basilisk/components/nsBrowserContentHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ nsBrowserContentHandler.prototype = {
}

#ifdef XP_WIN
// Handle "? searchterm" for Windows Vista start menu integration
// Handle "? searchterm" for Windows start menu integration
for (var i = cmdLine.length - 1; i >= 0; --i) {
var param = cmdLine.getArgument(i);
if (param.match(/^\? /)) {
Expand Down
12 changes: 6 additions & 6 deletions basilisk/components/shell/nsWindowsShellService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ OpenKeyForReading(HKEY aKeyRoot, const nsAString& aKeyName, HKEY* aKey)
// shell\open\command (default) REG_SZ <apppath> -osint -url "%1"
// shell\open\ddeexec (default) REG_SZ <empty string>
//
// - Windows Vista and above Protocol Handler
// - Windows 7 and above Protocol Handler
//
// HKCU\SOFTWARE\Classes\BasiliskURL\ (default) REG_SZ <appname> URL
// EditFlags REG_DWORD 2
Expand Down Expand Up @@ -184,7 +184,7 @@ static SETTING gSettings[] = {
// it will skip over this check.***
{ MAKE_KEY_NAME1("BasiliskHTML", SOC), VAL_OPEN, OLD_VAL_OPEN },

// Protocol Handler Class - for Vista and above
// Protocol Handler Class - for Windows 7 and above
{ MAKE_KEY_NAME1("BasiliskURL", SOC), VAL_OPEN, OLD_VAL_OPEN },

// Protocol Handlers
Expand All @@ -201,7 +201,7 @@ static SETTING gDDESettings[] = {
// File Handler Class
{ MAKE_KEY_NAME1("Software\\Classes\\BasiliskHTML", SOD) },

// Protocol Handler Class - for Vista and above
// Protocol Handler Class - for Windows 7 and above
{ MAKE_KEY_NAME1("Software\\Classes\\BasiliskURL", SOD) },

// Protocol Handlers
Expand Down Expand Up @@ -376,7 +376,7 @@ IsDefaultBrowserWin8(bool aCheckAllTypes, bool* aIsDefaultBrowser)
* by all Basilisk browsers.
*/
bool
nsWindowsShellService::IsDefaultBrowserVista(bool aCheckAllTypes,
nsWindowsShellService::IsDefaultBrowserWin7(bool aCheckAllTypes,
bool* aIsDefaultBrowser)
{
RefPtr<IApplicationAssociationRegistration> pAAR;
Expand Down Expand Up @@ -489,10 +489,10 @@ nsWindowsShellService::IsDefaultBrowser(bool aStartupCheck,
}
}

// Only check if Basilisk is the default browser on Vista and above if the
// Only check if Basilisk is the default browser on Windows 7 and above if the
// previous checks show that Basilisk is the default browser.
if (*aIsDefaultBrowser) {
IsDefaultBrowserVista(aForAllTypes, aIsDefaultBrowser);
IsDefaultBrowserWin7(aForAllTypes, aIsDefaultBrowser);
if (IsWin8OrLater()) {
IsDefaultBrowserWin8(aForAllTypes, aIsDefaultBrowser);
}
Expand Down
2 changes: 1 addition & 1 deletion basilisk/components/shell/nsWindowsShellService.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class nsWindowsShellService : public nsIWindowsShellService
NS_DECL_NSIWINDOWSSHELLSERVICE

protected:
bool IsDefaultBrowserVista(bool aCheckAllTypes, bool* aIsDefaultBrowser);
bool IsDefaultBrowserWin7(bool aCheckAllTypes, bool* aIsDefaultBrowser);
nsresult LaunchControlPanelDefaultsSelectionUI();
nsresult LaunchControlPanelDefaultPrograms();
nsresult LaunchModernSettingsDialogDefaultApps();
Expand Down
72 changes: 16 additions & 56 deletions basilisk/installer/windows/nsis/installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Var PreventRebootRequired
; StartMenuDir variable can use the common InstallOnInitCommon macro.
!define NO_STARTMENU_DIR

; On Vista and above attempt to elevate Standard Users in addition to users that
; Attempt to elevate Standard Users in addition to users that
; are a member of the Administrators group.
!define NONADMIN_ELEVATE

Expand Down Expand Up @@ -247,7 +247,7 @@ Section "-InstallStartCleanup"
; setup the application model id registration value
${InitHashAppModelId} "$INSTDIR" "Software\Mozilla\${AppName}\TaskBarIDs"

; Remove the updates directory for Vista and above
; Remove the updates directory
${CleanUpdateDirectories} "Mozilla\Basilisk" "Mozilla\updates"

${RemoveDeprecatedFiles}
Expand Down Expand Up @@ -314,12 +314,7 @@ Section "-Application" APP_IDX

; Default for creating Quick Launch shortcut (1 = create, 0 = don't create)
${If} $AddQuickLaunchSC == ""
; Don't install the quick launch shortcut on Windows 7
${If} ${AtLeastWin7}
StrCpy $AddQuickLaunchSC "0"
${Else}
StrCpy $AddQuickLaunchSC "1"
${EndIf}
StrCpy $AddQuickLaunchSC "0"
${EndIf}

; Default for creating Desktop shortcut (1 = create, 0 = don't create)
Expand Down Expand Up @@ -385,7 +380,7 @@ Section "-Application" APP_IDX
; For pre win8, the following keys should only be set if we can write to HKLM.
; For post win8, the keys below get set in both HKLM and HKCU.
${If} $TmpVal == "HKLM"
; Set the Start Menu Internet and Vista Registered App HKLM registry keys.
; Set the Start Menu Internet and Registered App HKLM registry keys.
${SetStartMenuInternet} "HKLM"
${FixShellIconHandler} "HKLM"

Expand All @@ -404,7 +399,7 @@ Section "-Application" APP_IDX
${EndIf}

${If} ${AtLeastWin8}
; Set the Start Menu Internet and Vista Registered App HKCU registry keys.
; Set the Start Menu Internet and Registered App HKCU registry keys.
${SetStartMenuInternet} "HKCU"
${FixShellIconHandler} "HKCU"

Expand Down Expand Up @@ -434,7 +429,7 @@ Section "-Application" APP_IDX
${CreateRegKey} "$TmpVal" "$0" 0

${If} $TmpVal == "HKLM"
; Set the permitted LSP Categories for WinVista and above
; Set the permitted LSP Categories
${SetAppLSPCategories} ${LSP_CATEGORIES}
${EndIf}

Expand Down Expand Up @@ -486,8 +481,7 @@ Section "-Application" APP_IDX
${If} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk"
ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandFullName}.lnk" \
"$INSTDIR"
${If} ${AtLeastWin7}
${AndIf} "$AppUserModelID" != ""
${If} "$AppUserModelID" != ""
ApplicationID::Set "$SMPROGRAMS\${BrandFullName}.lnk" "$AppUserModelID" "true"
${EndIf}
${LogMsg} "Added Shortcut: $SMPROGRAMS\${BrandFullName}.lnk"
Expand All @@ -508,36 +502,14 @@ Section "-Application" APP_IDX
${If} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
ShellLink::SetShortCutWorkingDirectory "$DESKTOP\${BrandFullName}.lnk" \
"$INSTDIR"
${If} ${AtLeastWin7}
${AndIf} "$AppUserModelID" != ""
${If} "$AppUserModelID" != ""
ApplicationID::Set "$DESKTOP\${BrandFullName}.lnk" "$AppUserModelID" "true"
${EndIf}
${LogMsg} "Added Shortcut: $DESKTOP\${BrandFullName}.lnk"
${Else}
${LogMsg} "** ERROR Adding Shortcut: $DESKTOP\${BrandFullName}.lnk"
${EndIf}
${EndIf}

; If elevated the Quick Launch shortcut must be added from the unelevated
; original process.
${If} $AddQuickLaunchSC == 1
${Unless} ${AtLeastWin7}
ClearErrors
${GetParameters} $0
${GetOptions} "$0" "/UAC:" $0
${If} ${Errors}
Call AddQuickLaunchShortcut
${LogMsg} "Added Shortcut: $QUICKLAUNCH\${BrandFullName}.lnk"
${Else}
; It is not possible to add a log entry from the unelevated process so
; add the log entry without the path since there is no simple way to
; know the correct full path.
${LogMsg} "Added Quick Launch Shortcut: ${BrandFullName}.lnk"
GetFunctionAddress $0 AddQuickLaunchShortcut
UAC::ExecCodeSegment $0
${EndIf}
${EndUnless}
${EndIf}
SectionEnd

; Cleanup operations to perform at the end of the installation.
Expand All @@ -555,15 +527,13 @@ Section "-InstallEndCleanup"
; value was before we changed it. To do so, we read it here and store it
; in our own registry key.
StrCpy $0 ""
${If} ${AtLeastWinVista}
AppAssocReg::QueryCurrentDefault "http" "protocol" "effective"
Pop $1
; If the method hasn't failed, $1 will contain the progid. Check:
${If} "$1" != "method failed"
${AndIf} "$1" != "method not available"
; Read the actual command from the progid
ReadRegStr $0 HKCR "$1\shell\open\command" ""
${EndIf}
AppAssocReg::QueryCurrentDefault "http" "protocol" "effective"
Pop $1
; If the method hasn't failed, $1 will contain the progid. Check:
${If} "$1" != "method failed"
${AndIf} "$1" != "method not available"
; Read the actual command from the progid
ReadRegStr $0 HKCR "$1\shell\open\command" ""
${EndIf}
; If using the App Association Registry didn't happen or failed, fall back
; to the effective http default:
Expand Down Expand Up @@ -891,11 +861,6 @@ Function leaveShortcuts
${MUI_INSTALLOPTIONS_READ} $AddDesktopSC "shortcuts.ini" "Field 2" "State"
${MUI_INSTALLOPTIONS_READ} $AddStartMenuSC "shortcuts.ini" "Field 3" "State"

; Don't install the quick launch shortcut on Windows 7
${Unless} ${AtLeastWin7}
${MUI_INSTALLOPTIONS_READ} $AddQuickLaunchSC "shortcuts.ini" "Field 4" "State"
${EndUnless}

${If} $InstallType == ${INSTALLTYPE_CUSTOM}
Call CheckExistingInstall
${EndIf}
Expand Down Expand Up @@ -1123,12 +1088,7 @@ Function .onInit
WriteINIStr "$PLUGINSDIR\options.ini" "Field 5" Bottom "87"

; Setup the shortcuts.ini file for the Custom Shortcuts Page
; Don't offer to install the quick launch shortcut on Windows 7
${If} ${AtLeastWin7}
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Settings" NumFields "3"
${Else}
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Settings" NumFields "4"
${EndIf}
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Settings" NumFields "3"

WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 1" Type "label"
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 1" Text "$(CREATE_ICONS_DESC)"
Expand Down
Loading

0 comments on commit d7589fa

Please sign in to comment.