Hello,
1. User browses to a file locally on his/her machine and selects existing configuration file
For this, you could use our "Browse for file" custom action. It could be configured without sequence and executed as a publish event on a "Browse for file" push button placed on a dialog.
This custom action will generate three properties :
1. AI_OFN_FILENAME property. Its value is resolved to the name of the chosen file, eg. "sample.exe"
2. AI_OFN_DIRECTORY. Its value is resolved to the path of chosen file, eg. "C:\Users\Sorin\Desktop\"
3. AI_OFN_FILEPATH. Its value is resolved to the fil path of the file, including its name, eg. : "C:\Users\Sorin\Desktop\sample.exe"
2. If file is selected, overwrite the install file with user file during install
For this you can create you own custom action.
For example, you can create your custom action as
a custom action written in C# or
a custom action written in C++.
You can also use the
VBScript or a
PowerShell custom action to implement this functionality.
This custom action should copy the file picked by the user to your needed location. This custom action should be "deferred type" and placed after "Add Resources" in the "Install Execution Stage" as you need to overwrite a file deployed by the package.
When writing this custom action you should use the above properties to reference your file.
Here you could find more information regarding how you should reference installer properties in C#/C++/PowerScript/VBS scripts custom actions:
How to set an installer property using custom actions
Also, please also take a look on how you could access installer properties in deferred custom actions :
Pass installer properties in deferred custom action
Best regards,
Sorin
FOLLOW US
Get the latest news in Application Packaging