sparrow
Posts: 3
Joined: Tue Jan 29, 2008 8:48 pm

Custom Action Help

Hi all

I'm trying to write a custom action using VBScript. The script works fine, except for one problem:
I'm trying to capture the target directory that the user has selected to install my application to. I've tried using Session.Property("TARGETDIR") and Session.Property("APPDIR"), but both of these return blank values.

Can anyone let me know how to retrieve the directory?

Thanks

Alex
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

You can get the installation folder by using Session.Property("APPDIR"). Please note that in order to have access to this property the custom action must not be set as "Deferred" in the "Custom Action Properties" page.
http://www.advancedinstaller.com/user-g ... rties.html

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sparrow
Posts: 3
Joined: Tue Jan 29, 2008 8:48 pm

Thanks for the reply, Cosmin.

I changed the Execution Option from Commit to Immediate, and this returns the correct directory.
However, my script still fails. I think it's because I'm firing it off in the wrong place.

What I need to do is call the script after all the files have been copied to the directory the user has chosen.

Is this possible?

Thanks
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

In order to run a custom action after the files are created you can schedule it under the "InstallFiles" standard action. You can see a standard action by using the "Show standard action" button on the toolbar in the "Custom Actions" page.

Also, you can schedule the custom action under the "InstallFinalize" standard action.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sparrow
Posts: 3
Joined: Tue Jan 29, 2008 8:48 pm

Excellent, it now works! Thanks for you help Cosmin, you've just made a sale to a new customer. :D

Return to “Common Problems”