Infodream
Level 3

Add sub-folder after Installdir with ProductName

Hi everyone,
I have a problem with the installation paths of my application in "multi-instance" mode.
I want to assign the "product name" as a component of the installation path (INSTALLDIR).
The problem is that I can't integrate [ProductName] as part of the path (the program takes the keyword and not the path).

The best I can do is that "Product Name" is the last element of the path. I can't get to the component level to put a subdirectory next.

For example, I want my "root" installation directory to be as follows:
C:\Test\Test-1 (where "Test-1" is the product name).

If I assign this value in INSTALLDIR, at the component level, I can't put for example :

[INSTALLDIR]Bin (to indicate at the end: C:\Test\Test-1\Bin)

The idea is that if I install my program a second time, I get to: C:\Test\Test-2\Bin

Note: "Bin" is only one of the application's subdirectories.

Do you have a solution for me?
Thank you in advance.
Labels (1)
0 Kudos
3 Replies
rguggisberg
Level 13

You didn't say what you are doing so far... I will guess that you are on the 'General Information' tab and put something like this in there:
C:\Test\[ProductName]
First thing I would do is search your custom actions and verify that none of them is modifying INSTALLDIR. If there are any, then you will have to add [ProductName] there instead of on the 'General Information' tab.
0 Kudos
Infodream
Level 3

rguggisberg wrote:
You didn't say what you are doing so far... I will guess that you are on the 'General Information' tab and put something like this in there:
C:\Test\[ProductName]
First thing I would do is search your custom actions and verify that none of them is modifying INSTALLDIR. If there are any, then you will have to add [ProductName] there instead of on the 'General Information' tab.


Thanks, I try it and verify if I made a mistake
0 Kudos
Georg1
Level 4

I think I would probably add a new Variable like "CurrentInstallDir" and set this in a custom action appropriate to something like [InstallDir] + . Do this after the destination folder dialog where the user selects the target folder (if you have the ui sequence).
Then you can use this new "CurrentInstallDir" combined with any subfolder as destination for your components, e.g. [CurrentInstallDir]\Bin
For the variable name be sure to make it public (upper-case) and add it to secure properties so its transfered from ui to execute sequence.

Instead of the new variable you could of course modify the INSTALLDIR directly like rguggisberg suggested if you dont need the original value anymore.



That said, I'm curious if this is even possible because as soon as you start the setup after the product is already installed you should enter maintenance mode and only be able to modify the existing installation - as long as you don't change the product guid. At least thats what I understood so far, can anybody explain to me if that's wrong?
0 Kudos