mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add disable portable mode code
This commit is contained in:
parent
ba46ce09dc
commit
61845dd0db
2 changed files with 35 additions and 1 deletions
|
|
@ -7,6 +7,8 @@ namespace Wox.Core.Configuration
|
|||
void DisablePortableMode();
|
||||
void RemoveShortcuts();
|
||||
void RemoveUninstallerEntry();
|
||||
void CreateShortcuts();
|
||||
void CreateUninstallerEntry();
|
||||
bool IsPortableModeEnabled();
|
||||
void MoveUserDataFolder(string fromLocation, string toLocation);
|
||||
void VerifyUserDataAfterMove(string fromLocation, string toLocation);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,25 @@ namespace Wox.Core.Configuration
|
|||
|
||||
public void DisablePortableMode()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
try
|
||||
{
|
||||
MoveUserDataFolder(portableDataPath, roamingDataPath);
|
||||
CreateShortcuts();
|
||||
CreateUninstallerEntry();
|
||||
|
||||
// always dispose UpdateManager???????????
|
||||
// CHANGE TO PRIVATE/INTERNAL METHODS
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//log and update error message to output above locations where shortcuts may not have been removed
|
||||
#if DEBUG
|
||||
throw;
|
||||
#else
|
||||
throw;// PRODUCTION LOGGING AND CONTINUE
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
public void EnablePortableMode()
|
||||
|
|
@ -37,6 +55,8 @@ namespace Wox.Core.Configuration
|
|||
MoveUserDataFolder(roamingDataPath, portableDataPath);
|
||||
RemoveShortcuts();
|
||||
RemoveUninstallerEntry();
|
||||
|
||||
// always dispose UpdateManager???????????
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
@ -78,5 +98,17 @@ namespace Wox.Core.Configuration
|
|||
{
|
||||
FilesFolders.VerifyBothFolderFilesEqual(fromLocation, toLocation);
|
||||
}
|
||||
|
||||
public void CreateShortcuts()
|
||||
{
|
||||
portabilityUpdater.CreateShortcutsForExecutable(exeName, ShortcutLocation.StartMenu, false);
|
||||
portabilityUpdater.CreateShortcutsForExecutable(exeName, ShortcutLocation.Desktop, false);
|
||||
portabilityUpdater.CreateShortcutsForExecutable(exeName, ShortcutLocation.Startup, false);
|
||||
}
|
||||
|
||||
public void CreateUninstallerEntry()
|
||||
{
|
||||
portabilityUpdater.CreateUninstallerRegistryEntry();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue