I would like to replace a configuration file using a custom action of type 'Execute Inline Script Code'
I chose script type 'Visual basic script(*.vbs)'
Install execution stage is the last custom action in 'Add Resources' stage.
The problem is, that the configuration file is not changed after the setup has finished.
Running the vbs-script manually after the installation works, but not from AI-Setup.
Here is my vbs-script:
Code: Select all
On Error Resume Next
Const appDataDir = "C:\ProgramData\MyCompany\ApplicationData\PostgreSQL\10\data"
Const configFileName = "postgresql.conf"
Dim fso
'Konfigurationsdatei austauschen:
Set fso = CreateObject("Scripting.FileSystemObject")
call fso.CopyFile(".\" & configFileName, appDataDir & "\" & configFileName, True)
Set fso = Nothing
Properties:
+ 32-bit script
+ No action data
+ Script type: Visual basic script(*.vbs)
Execution Time:
+ After the system has been successfully modified (commit)
Execution options:
+ Run under the LocalSystem account with full privileges (no impersonation)
+ Wait for custom action to finish before proceeding
+ Fail installation if cutom action returns an error
Execution Stage Condition:
+ Install
+ Maintenance
+ No condition
Thanks in advance
Oliver