Changing installer property paths - 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!

JunJur
Posts: 4
Joined: Fri Jan 12, 2007 11:36 am

Changing installer property paths

Hi all,

I am using AI Enterprise and I want to specify 2 paths:
- a application path (stored in APPDIR property)
- a data path (stored in AppDataFolder)

Now I extended the normal FolderDlg with another Path Edit box and a Browse button. One Path Edit box is assigned to Property Name "APPDIR" and the other box to "AppDataFolder".

The Browse button for the "APPDIR" Path Edit box is set to:
- Event: [_BrowseProperty]
- Argument: APPDIR
- Condition: 1

The Browse button for the "AppDataFolder" Path Edit box is set to:
- Event: [_BrowseProperty]
- Argument: AppDataFolder
- Condition: 1

The Next button on the same dialog is setup with the event:
- Event: SetTargetPath
- Argument: APPDIR
- Condition: 1

Everything seems to work fine, the installation will complete succesfully. The APPDIR is used as installation folder, however the AppDataFolder is not updated with the value showed in the Path Edit box. It will always remain the default value set by Windows: "C:\Documents and Settings\$USER$\Application Data\$DATAFOLDER$".

I set both properties APPDIR and AppDataFolder to a default value through a small VB script using the Session.Property command. This works fine, the Path Edit boxes show exactly the path as mentioned in the script.

How can I set the AppDataFolder property after the FolderDlg? This data folder can also be on another drive.

Thanks in advance for any help!

Kind regards,
Jurjen
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Jurjen,
however the AppDataFolder is not updated with the value showed in the Path Edit box. It will always remain the default value set by Windows: "C:\Documents and Settings\$USER$\Application Data\$DATAFOLDER$".
You cannot browse the AppDataFolder because this property is set by Windows Installer at the beginning of every sequence (UI and Execute). So after you browse for it the value is changed by Windows Installer under InstallExecuteSequence with the default value.

What you need to do is to create a property under "Install Parameters" page (MYAPPDATAFOLDER for example) and a "New Folder->Property Based" in the "Files and Folders" page using MYAPPDATAFOLDER property.

To initialize MYAPPDATAFOLDER with the value of the AppDataFolder property you need to do like this:

In the custom action page create a "Property Set With Formatted" custom action under "InstallUISequence->Begin" and use this options for it:
Property Name: MYAPPDATAFOLDER
Formatted Text: [AppDataFolder]

Now drag this custom action while shift key is pressed under "InstallExecuteSequence->Begin" standard action (use "Show Standard Action" toolbar menu to make standard action visible).

Now use this new property in the dialog editor.

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
JunJur
Posts: 4
Joined: Fri Jan 12, 2007 11:36 am

Hi Gigi,

I was already implementing the same :) However, I initialise the property through a script, cause the property I use depends on the system configuration (if other drive available, other drive should be used). So, I don't use the custom action "Property Set With Formatted". This works fine for me... Anyway, thanks for your help (again)!

Kind regards,
Jurjen

Return to “Common Problems”