- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Custom Action CopyFile doesn't work
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Custom Action CopyFile doesn't work
I attached an vbs script that does copying a file with name change.
Once the line with copyfile is present the setup completes with 'was intteruped error'.
If I remove that the script executes. What am I missing?
It's attached to after ready to install dialog event.
Dim sInstalldir
sInstalldir = Session.Property("INSTALLDIR")
MsgBox "BEFORE:" & sInstalldir
Dim pFs
Set pFs = CreateObject("Scripting.FileSystemObject")
Dim AppConfig
AppConfig = sInstalldir & "App.exe.config"
If pFs.FileExists(AppConfig) Then
pFs.CopyFile AppConfig , "C:\Program Files (x86)\APP\App.exe.bak" , True
End If
Please note that I tried MoveFile as well. The path is valid.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
If the script is working then try to sequence the customaction after file transfer or after register product.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
The script works and this seems to be related with permission. I didn't have to force run as admin on calling the msi.
After adding this script this seems required...
Another thing. Can you send up-to-date link on how to access installdir on after file transfer event?
Many links in help navigate to some help which is removed from your help base. Like comments here:
https://community.flexera.com/t5/InstallShield-Forum/How-get-INSTALLDIR-in-custom-action/td-p/24481
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Great!, Its expected that windows Installer Properties wont be accessible in after file transfer, Refer the attachment,
I have also created a sample project with custoamction sequenced after setup type dialog and its shows the installdir and copy file successfully, Please try the attached sample.