Create folder with name of computer - 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!

Arthur
Posts: 69
Joined: Wed May 19, 2010 9:53 am

Create folder with name of computer

Hi,

How do I create a folder with the same name as the computer that it it being installed on? I have tried using the property [|ComputerName] but this resolves to an empty string at install time, so does not work. I've also tried [ComputerName], nut this resolves to ComputerName, which is no good.

Arthur
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Create folder with name of computer

Hello Arthur,

In order to achieve what you want you can take a look on our "Filename containing property value" thread.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Arthur
Posts: 69
Joined: Wed May 19, 2010 9:53 am

Re: Create folder with name of computer

Hi,

I have seen that thread, and that is the method that I was trying to use. For some reason it stops working when the package is installed as a chained package. I'm just using a VB Script to do what I want instead now, which seems to work.

Thanks, Arthur
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Create folder with name of computer

Hello Arthur,
For some reason it stops working when the package is installed as a chained package.
I'm not sure why you are encountering this behavior. However, if you want to create a folder with name of computer under installation folder (APPDIR) you can try this:
- Go to "Install Parameters" page and create a property like this:
  • Name: COMPUTER
    Value: Your Value
- Go to "Files and Folders" view and create a new property-based folder using COMPUTER property.
- Go to "Custom Actions" page and add a "Set installer property" custom action with sequence, scheduled before "Wizard Dialogs Stage -> Paths Resolution" action group, like this:
  • Property: COMPUTER
    Formatted: [WindowsVolume][ComputerName]
- Select the above custom action and, while pressing the Shift key, drag it before "Install Execution Stage -> Paths Resolution" action group. From "Custom Action Properties" right pane enable the "Execute only once if present in both sequence tables" execution option.
- Add a new "Set installer property" custom action with sequence, scheduled before "Wizard Dialogs Stage -> Paths Resolution -> Cost Finalize" action group, like this:
  • Property: COMPUTER
    Formatted: [APPDIR]\[ComputerName]
- Build and run your project.

Also, here's attached a sample, created using our 9.5 version of Advanced Installer, which implements a similar scenario.
sample.zip
(2.57 KiB) Downloaded 344 times
All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”