Programatically get ApplicationData path

Inno Setup {userappdata} always points to C:\
This commit is contained in:
valentinbreiz 2020-12-10 18:58:20 +01:00
parent 0ba4f6c418
commit cf56bb9eec
2 changed files with 7 additions and 2 deletions

View file

@ -15,6 +15,10 @@
#define VSVersion "vs2019"
#endif
#ifndef RealPath
#define RealPath {userappdata}
#endif
#if BuildConfiguration == "DevKit"
; devkit releases are not compressed
#pragma warning "Building Dev Kit release"
@ -36,7 +40,7 @@ AppSupportURL=http://www.goCosmos.org/
AppUpdatesURL=http://www.goCosmos.org/
AppVersion={#ChangeSetVersion}
SetupMutex=CosmosSetupMutexName,Global\CosmoSetupMutexName
DefaultDirName={userappdata}\Cosmos User Kit
DefaultDirName={#RealPath}\Cosmos User Kit
DefaultGroupName=Cosmos User Kit
OutputDir=.\Setup\Output
OutputBaseFilename=CosmosUserKit-{#ChangeSetVersion}-{#VSVersion}

View file

@ -29,7 +29,8 @@ namespace Cosmos.Build.Builder.BuildTasks
_defines = new Dictionary<string, string>()
{
["BuildConfiguration"] = configuration,
["ChangeSetVersion"] = releaseVersion
["ChangeSetVersion"] = releaseVersion,
["RealPath"] = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
};
}