Hello Toren,
Here is a little PowerShell script that copies a file from ProgramFiles to AppData folder. For this, I have used the "$env:APPDATA" environment variable which resolves to the following path:
The script is as it follows:
Code: Select all
Copy-Item -Path "the\path\to\your file" -Destination $env:APPDATA
This can be added in your Advanced Installer project by going to "Custom Actions" page and adding a "Run PowerShell inline script" custom action
with sequence. In order to add a custom action with sequence, all you have to do is to press the
"Add custom action with sequence" button which is placed to the right side of the custom action's name.
Since you probably want to copy a file that you have earlier installed, you should schedule this custom action after the
"Add Resources" action group and with its execution time of
"When the system is being modified (deferred)".
I have attached a screenshot to this thread for your reference.
- PowerShell CA.PNG (56.21 KiB) Viewed 4319 times
All the best,
Catalin