Enivronment Variables in an Inline VB Script - Advanced Installer Community
rob.cvnz
Posts: 1
Joined: Mon Sep 23, 2013 2:17 am

Enivronment Variables in an Inline VB Script

Hi, I'm trying to execute the following vbs script as an inline function

Code: Select all

WScript.CreateObject("WScript.Shell").run "cmd.exe /c echo N | xcopy ""%ProgramData%\My Company\My Product v1\license.lic"" ""%ProgramData%\My Company\My Product v2\"" "
Which works in windows but fails during the install process...

Also as a side note, it would be nice to have a "Run Script" button in order to test instead of having to run the whole installer.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Enivronment Variables in an Inline VB Script

Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

I think there are some syntax problem. Please note that I had used the following code in order to copy the related file using the XCOPY command.

Here's the code:

Code: Select all

Set objShell = CreateObject("WScript.Shell")

objShell.Run("cmd.exe /c echo N | xcopy C:\ADanutTests\MultipleInstances\test\seVaMuta.txt C:\ADanutTests\MultipleInstances ")
It has been tested on Windows 7.

You can take a look on the XCOPY Command article which may be useful.
Also as a side note, it would be nice to have a "Run Script" button in order to test instead of having to run the whole installer.
Indeed it would help a lot. Thank you for suggestion. As a workaround you can place your Execute inline script code custom action with sequence in the “Wizard Dialogs Stage” after the “Searches” stage, for testing so you don't need to go through the all the dialog wizzard.

Please let us know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”