Mypal portable mode

This commit is contained in:
K4sum1 2025-03-24 16:06:08 -07:00
commit 633ef1c426
24 changed files with 299 additions and 25 deletions

View file

@ -8,6 +8,7 @@
[scriptable, uuid(f8a26b94-49e5-4441-8fbc-315e0b4f22ef)]
interface nsIWindowsShellService : nsIShellService
{
void cancelPortableMode();
/**
* Provides the shell service an opportunity to do some Win7+ shortcut
* maintenance needed on initial startup of the browser.

View file

@ -369,6 +369,31 @@ IsDefaultBrowserWin8(bool aCheckAllTypes, bool* aIsDefaultBrowser)
}
}
NS_IMETHODIMP
nsWindowsShellService::CancelPortableMode()
{
nsresult rv;
nsCOMPtr<nsIFile> portmodemark;
rv = NS_GetSpecialDirectory(NS_OS_CURRENT_PROCESS_DIR,
getter_AddRefs(portmodemark));
NS_ENSURE_SUCCESS(rv, rv);
rv = portmodemark->AppendNative(NS_LITERAL_CSTRING("pmprt.mod"));
NS_ENSURE_SUCCESS(rv, rv);
bool fileExists;
rv = portmodemark->Exists(&fileExists);
NS_ENSURE_SUCCESS(rv, rv);
if (fileExists)
portmodemark->Remove(false);
return NS_OK;
}
/*
* Query's the AAR for the default status.
* This only checks for BasiliskURL and if aCheckAllTypes is set, then