shireburn
Posts: 5
Joined: Mon Aug 12, 2013 9:16 am

Custom Folder Name under [APPDIR]

We need to create a folder under the Application Folder [APPDIR]. This folder has to be named via the value of a property which the user set at the Dialogs Stage.

Example
+[APPDIR]
+[FolderWithCustomName]
+Contents & Files

We believe it's very simple but we just couldn't manage to get it right. Can you help us out please?
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Custom Folder Name under [APPDIR]

Hello,

In order to achieve that you can go in the Files and Folders page, select the Application Folder and the add a Property-based folder using the [Folder] >> [Property Based] toolbar button. Property based folders will be resolved at install time to the values from the respective property. This property can be one of the Windows Installer Folders, the result of a Search operation or a custom property set in the Install Parameters page.

If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
JPP
Posts: 18
Joined: Wed Oct 28, 2015 4:34 pm

Re: Custom Folder Name under [APPDIR]

I know I am bringing back an old post but I need to do same the same thing as original poster (name folders inside the Application Folder using properties) and this solution doesn't seem to work. Even if I
select the Application Folder and the add a Property-based folder using the [Folder] >> [Property Based] toolbar button.
, my new folder always gets added to the root "Target Computer" section. I am currently using version 12.5, is there anything I am doing wrong? I also tried setting the "Target Name" property in the Edit Folder dialog on a regular folder (I tried with and without the brackets []) but the folder is created using that exact text and not the property value.

I also tried leaving the property based folders at root (Target Computer) and assigning APPDIR at the begining of my property but then I get an error message saying that the folders don't exist as soon as I launch the install.

What is the best/proper way to do this? Is it possible?

Thank you!
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Custom Folder Name under [APPDIR]

Hello and welcome to our forums,

To achieve what you want you can use a property-based folder as my colleague suggested. Here are the steps to proceed:
1. go to "Properties" page and add a new property like this:
  • Name: MY_FOLDER_PROP
    Value: [|WindowsVolume]
2. go to "Files and Folders" page and create a new property-based folder using the above property (MY_FOLDER_PROP)
3. go to "Custom Actions" page and add a new "Set installer property" custom action with sequence, scheduled after "Wizard Dialogs Stage -> Paths Resolution" action group, like this:
  • Property: MY_FOLDER_PROP
    Value: [APPDIR][FOLDER_NAME_PROP]
4. select the above added custom action and, while keeping the [SHIFT] key pressed, drag and drop it under "Install Execution Stage -> Paths Resolution" action group; in this way the custom action will be shared between the above installation stages
5. click on the "Advanced execution scenarios..." blue link and check the "Skip action in Install Execution Stage if executed in Dialogs Stage" option
6. rebuild and test your project

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
JPP
Posts: 18
Joined: Wed Oct 28, 2015 4:34 pm

Re: Custom Folder Name under [APPDIR]

Thanks for your answer Daniel. I was already doing very close to what you are suggesting. I did end up finding what my problem was and fixing it. I found out I needed to set my property to [WindowsVolume] ( {APPDIR][FOLDER_NAME_PROP] doesn't exist yet at that point in the process) using a custom action before the Paths Resolution sequence and then set my proper installation path later on.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Custom Folder Name under [APPDIR]

You're always welcome. I'm glad you sorted things out.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”