From e3bec84d3196b45f1b031cb51747a6e6ecac0d90 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Thu, 31 May 2018 00:44:31 -0400 Subject: [PATCH] Tweaks to the Inno Setup file --- dist_assets/win/pyfa-setup.iss | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/dist_assets/win/pyfa-setup.iss b/dist_assets/win/pyfa-setup.iss index 3d3e3df2d..7984da087 100644 --- a/dist_assets/win/pyfa-setup.iss +++ b/dist_assets/win/pyfa-setup.iss @@ -5,7 +5,7 @@ ; we do some #ifdef conditionals because automated compilation passes these as arguments #ifndef MyAppVersion - #define MyAppVersion "1.15.0" + #define MyAppVersion "2.1.0" #endif #ifndef MyAppExpansion #define MyAppExpansion "Vanguard 1.0" @@ -64,7 +64,7 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{ Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1 [Files] -Source: "{#MyAppDir}\pyfa.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#MyAppDir}\pyfa.exe"; DestDir: "{app}"; Flags: ignoreversion; AfterInstall: RemoveFromVirtualStore Source: "{#MyAppDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs ; NOTE: Don't use "Flags: ignoreversion" on any shared system files @@ -104,6 +104,22 @@ begin FSWbemLocator := Unassigned; end; +procedure RemoveFromVirtualStore; +var + VirtualStore,FileName,FilePath:String; + DriveChars:Integer; +begin + VirtualStore:=AddBackslash(ExpandConstant('{localappdata}'))+'VirtualStore'; + FileName:=ExpandConstant(CurrentFileName); + DriveChars:=Length(ExtractFileDrive(FileName)); + if DriveChars>0 then begin + Delete(FileName,1,DriveChars); + FileName:=VirtualStore+FileName; + FilePath:=ExtractFilePath(FileName); + DelTree(FilePath, True, True, True); + end; +end; + function PrepareToInstall(var NeedsRestart: Boolean): String; begin if(IsAppRunning( 'pyfa.exe' )) then