There are known scenario requirements when you need to migrate and package into an MSIX setup a classic Win32 app that needs to write user data/settings into a folder and or file located outside of the VFS folder.
For instance let's say you need to package into an MSIX setup a Win32 app that writes and reads some of its data from the following file:
Code: Select all
%PROGRAMDATA%\MyAppFolderOutsideVFS\MyAppSettings.config
Code: Select all
%PROGRAMDATA%\MyAppFolderOutsideVFS\
And that is all. After MSIX installation, on application first run the above MyAppFolderOutsideVFS\MyAppSettings.config folder path and file will be created under %PROGRAMDATA% system folder.
Note: The above folder will not be created as long as there isn't at least one file included inside. If the folder is created as an empty folder in "Files and Folders" view, then it won't be created after MSIX installation.
Here it is attached a sample project created with Advanced Installer 20.3.1 that implements this scenario.
Alternatively, as another solution approach for this scenario you can use our "PowerShell Scripts" support in "AppCompat" view. More exactly you can create a PowerShell script (e.g. createFileFolder.ps1) with the following code and execute it from your MSIX package:
Code: Select all
new-item $Env:PROGRAMDATA\MyAppFolderOutsideVFS -ItemType Directory
new-item $Env:PROGRAMDATA\MyAppFolderOutsideVFS\MyAppSettings.config
1. create a new "Architect" project type and add an MSIX build in "Builds" view
2. go to "AppCompat" view and add a new "Start PowerShell Script" fix-up configured to run the above createFileFolder.ps1 script like this:
3. build and run your setup project
Here it is attached a sample project created with Advanced Installer 20.3.1 that implements this scenario.
Hope this was useful for getting a starting point about how to take advantage of our PowerShell Scripts support in "AppCompat" view.
All the best,
Daniel