mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 15:58:39 +09:00
Mypal portable mode
This commit is contained in:
parent
32c50fd018
commit
633ef1c426
24 changed files with 299 additions and 25 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue