Create Folder based on property value - Advanced Installer Community
tuukkap
Posts: 2
Joined: Fri Feb 11, 2022 10:39 am

Create Folder based on property value

Hi,

I've been fighting with an issue where I'm trying to create folder on target machine based on property. Issue is that folder is always created based on property's default value and not the updated value during installation.

Explanation:
1. There's property named LogFolder which has initial value of "C:\ProgramData\Test"
2. I have made a dialog which is used to change LogFolder parameter's value
3. As debugging I made additional dialog which displays LogFolder's value after user has changed LogFolder and I see that the value gets changed as it should
4. In "Files and Folders" I have created property based folder from LogFolder

During installation no matter what the value is changed to in step 2 I always end up with new folder "C:\ProgramData\Test"

All tips are highly appreciated,
Tuukka
Liviu
Posts: 1420
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Create Folder based on property value

Hello Tuukka and welcome to our forums,

That happens because you need to use a public property.

Can you please change the property name from "LogFolder" to "LOGFOLDER"?

Only a Public Property is passed on from the Wizard Dialogs Stage (in which the dialogs are showed) to the Install Execution Stage (in which the system is modified).

Public properties contain only upper-case letters in their name. The difference between Private and Public Properties consists in the way their values are being passed on.

Please have a look on the Windows Installer Properties article which may be useful to you.

Hope this helps! If you have any other questions, please don’t hesitate to contact us.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
tuukkap
Posts: 2
Joined: Fri Feb 11, 2022 10:39 am

Re: Create Folder based on property value

Huge thanks Liviu! That solved the issue immediately :)

Hope you have nice weekend ahead,
Tuukka
Liviu
Posts: 1420
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Create Folder based on property value

You're welcome, Tuukka! :)

You have a nice weekend, too!

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”