Example of using vbscript as a custom action - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

aosborne
Posts: 4
Joined: Mon Nov 15, 2010 6:29 am

Example of using vbscript as a custom action

Hi,

Would it be possible to get an example of how to use a vbscript as a custom action that occurs after the software is installed but before the process completes. I need to edit a ini file that already exists on the machine (prior to the install) with information from the install.

I'm finding the help information very confusing, and there aren't any real world examples that I can find.

So in summary I'd like to call a vbscript after installation, and pass it details of the installation directory. The script would then edit an ini file with this information.

Any assistance would help, this script is to run on a windows 7 and xp machine.

Thanks,
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Example of using vbscript as a custom action

Hello and welcome to Advanced Installer Forums,

Since you are new, I highly recommend you read our tutorials for a better understanding of how to use Advanced Installer to efficiently deploy your products.
This will also help you better understand support team's suggestions now and in the future. The simple and professional tutorials are especially important.

Instead of rolling out your own vbscript to deal with .ini editing, you could try using an INI file from the Files and Folders page and configure it to update your existing INI.

If you still need to edit an INI using vbscript, right click on Install, under InstallExecuteSequence on your Custom Actions page, select "Show standard action"->"Before Finalization"->"InstallFinalize". Place your custom action under InstallFinalize and it will be executed at the very end of the install process.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
aosborne
Posts: 4
Joined: Mon Nov 15, 2010 6:29 am

Re: Example of using vbscript as a custom action

Hi Gabriel,

Thanks for your post.

I've worked through the tutorials that I think apply to what I am trying to do. I don't think I can use the INI file feature because the file is pre-existing and I have to look into the registry to find out where it is.

Thanks for the hints on getting VBScript to work, but what I am after is an example of how to pass parameters correctly from advanced installer to the script.

Kind regards,

Adam
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Example of using vbscript as a custom action

Hello Adam,
Thanks for the hints on getting VBScript to work, but what I am after is an example of how to pass parameters correctly from advanced installer to the script.
You can use Session.Property("MY_PROP") to achieve this. Where MY_PROP is a public property you set from within the installer.
Also, as an example you may find helpful this article from our user guide.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”