Custom Inline Script: Add Folder Location - 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!

c.leson
Posts: 2
Joined: Thu Apr 08, 2010 2:16 pm

Custom Inline Script: Add Folder Location

Hi there,

i want to add a Custom Action for Install Action, a VBScript Inline.
With this Script i want to write the folder location for the CommonAppDataFolder in an Ini-file in the APPDIR folder
This location is different for each Windows version and is not an environment variable.
Is this possible and how?

Thanks a lot,

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

Re: Custom Inline Script: Add Folder Location

Hi Christian,

You will have to do the following:
- create an INI file in the files and folder page
- use a property in place of the location, in that ini
- in your script inline custom action set that property to whatever location you found
- make sure you place your custom action somewhere before InstallFiles standard action. After AppSearch standard action would be a good place, so that the property is set by your custom action before it being written in the ini.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
c.leson
Posts: 2
Joined: Thu Apr 08, 2010 2:16 pm

Re: Custom Inline Script: Add Folder Location

Hi GabrielBarbu,

thanks for your answer. I'm not sure if I understand you quite well.
I created a INI file in ther app dir.
I made a new section.
Now I want to have a key like "location = %CommonAppDir%" where %CommonAppDir% is set to the real path of the directory which will be inserted via inline script.
I don't fully understand the term "property" which you used.
Maybe you can give me a slightly more advanced introduction to this.
Thanks again,

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

Re: Custom Inline Script: Add Folder Location

Hi Christian,

I am referring to a Windows Installer Property.
If CommonAppDir is an environment variable you are somehow setting, use [%CommonAppDir] which is a reference to the environment variable.

Otherwise use the property you are setting from your custom action.

The ini would have something like:

Code: Select all

location = [%CommonAppDir] 
or

Code: Select all

location = [SOMEPROPERTY]
in it. Note the uppercase letter. It is recommenced you always use all-uppercase letters for property names, unless you specifically know otherwise.
The property would be resolved when the ini is created. Think of properties as variables that can have different values.

You can use MsiGetProperty or MsiSetProperty to manipulate properties from within a C/C++ custom action.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”