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!

4o66
Posts: 2
Joined: Fri Jan 12, 2007 4:32 pm
Location: Corona, Ca

Session.Property Not working

Custom Attached Action
Under Commit in InstallExecuteSequence

File: xmlsetup.vbs
Function name: XMLSetup
Synch Exe, ignore return code
Exec Options: Commit
Scheduling: Always Exec
Condition: NOT Installed

Here's the code:

Function XMLSetup()
MsgBox Session.Property("USERNAME") & " TEST " & Session.Property("ProductID")
End Function

The output is a Message box with only the word "TEST" in it.

What in the world am I doing wrong? (I am a networking guy, not a programmer.)

I am repackaging a program for distribution via active directory. The program (not written by me) uses an xml file in the logged in user's my docs folder for all of it's options.
The install puts a template version of the xml file in place, and I am attempting to use CreateObject("Microsoft.XMLDOM") to put the user specific information into the file. The vbs file works file from the command prompt if i harcode the information to be inserted. I am trying to pass a folder name from the install to the script as a text string using session.property, but the string is always empty. To test wether it was passing information or not I tried the above vbs code in the file.

Thanks.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

You get this behavior because you don't have access to properties under a deferred,commit type of custom actions. To have access to properties use "Immediate execution" option as "Execution option" for your custom action. Only CustomActionData property can be accessed by a deferred custom action. Read more about properties here:
http://msdn2.microsoft.com/en-gb/library/aa367437.aspx

On how to use custom actions in Advanced Installer please see:
http://www.advancedinstaller.com/user-g ... -page.html

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
4o66
Posts: 2
Joined: Fri Jan 12, 2007 4:32 pm
Location: Corona, Ca

Okay, how can I run an attached script, so that it runs AFTER the files have been copied to the destination directory, AND has access to the session.properties(s)?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

You can schedule the custom action under "InstallExecuteSequence->InstallFinalize" standard action (make it visible from "Show Standard Action" toolbar menu). Use "Immediate execution" as "Execution option" and (NOT Installed) as condition.

Hope this helps.

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”