[solved] When is "APPDIR" available in VB script? - Advanced Installer Community
a.guelle
Posts: 98
Joined: Tue May 19, 2015 2:23 pm

[solved] When is "APPDIR" available in VB script?

Hi Folks,

am running an inline VB script that manipulates an installed file. So I need the installation directory from:

Code: Select all

Session.Property("APPDIR")
It seems that this is only available if I run my custom Action with Execution Time "Immediately". But to that time my file is not installed yet.

1. How shall I proceed?
2. Im always struggeling with the Standard Actions because I never know what habppens when. Is there an overview what the standard actions are doing?
Last edited by a.guelle on Wed Jun 24, 2015 9:20 am, edited 1 time in total.
a.guelle
Posts: 98
Joined: Tue May 19, 2015 2:23 pm

Re: When is "APPDIR" available in VB script?

I now made a workaround by launching my script drom a .VBS file. This can be run deferred AND I am able to pass [APPDIR] as an argument.

Building a dom maniplulator on VBS = 1 hour
Getting it to work from Advanced Installer = 1 day

Working with Advanced Installer is like walking on quicksand.
codesynergy
Posts: 100
Joined: Fri Nov 14, 2014 10:29 pm

Re: When is "APPDIR" available in VB script?

Although I have not used VBS custom actions in my projects, I assume they work same as any other custom action. Meaning, you do not have direct access to MSI properties in deferred custom actions. You have to pass the properties through the "Action Data" field. According to Microsoft's best practices, if you are making any system changes with this VBS file, it should be run as a deferred custom action.

It is important to note, this is not an Advanced Installer issue. It is the way MSI's are designed (very poor design in my opinion). Advanced Installer actually makes it easier to pass properties into deferred custom actions, by providing the "Action Data" field. In other tools (like InstallShield), you have to create a separate custom action to pass in properties (a lot messier).
Im always struggeling with the Standard Actions because I never know what habppens when. Is there an overview what the standard actions are doing?
I 100% agree with you on this. It's never been clear to me what it happening at any given point in the installation. Microsoft's documentation for Standard Actions is very shallow. I would also be interested in some documentation that provides in depth information on what exactly is happening in a given Standard Action. http://wixtoolset.org provides some additional information on certain Standard Actions.
a.guelle
Posts: 98
Joined: Tue May 19, 2015 2:23 pm

Re: When is "APPDIR" available in VB script?

Yeah information seem to be wide spreaded over the net. Passing my property as "Action Data" did not work either the property was also empty. The only way was to pass the argument to a "Launch installed file" action and this does not make sense to me.
I agree that the core problem seems to be the MSI architecture so sorry for my bashing against AI. But at the end of the day I hoped that a "wizarding" tool like AI could make my MSI work less painful...

Return to “Common Problems”