cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dsananes
Level 3

Dynamic folder name

Hello all,

I'm using Basic MSI Project and I wanted to know if there is a way to dynamically name a folder, for example: the name of the folder will be taken from a property.

Thanks,
David
Labels (1)
0 Kudos
(7) Replies
Dan_Galender
Level 10

You can use a "Set a Directory" custom action to accomplish this.
0 Kudos
dsananes
Level 3

Thanks for your reply but it's not helping me and I'll explain my purpose.
I have 2 products that I want to deploy, both of the product share 95% percent of the files.
Each product has a different folder name.
Because I can't share one component with multi folders I thought maybe I will create one folder with one component that holds the shared files and dynamically change the folder name according to a property that will tell me which product is it.
0 Kudos
Dan_Galender
Level 10

If I understand your scenario properly, "Set a Directory" custom actions should allow you to accomplish this. Now that you've clarified a little more, maybe you could have 2 such actions set the same directory property (the one that serves as the destination of those components) to one value or the other based on action conditions.
0 Kudos
dsananes
Level 3

Thanks,
I think you are right and I am now trying your solution, for some reason I keep getting an error when I use the "Set a Directory" custom action:
"Error 1606 could not access network location".
I'll try a little harder to find out 🙂
0 Kudos
Dan_Galender
Level 10

Doesn't that message go on to say what directory it's having a problem with? Can you post that? Can you also post the parameter of the action(s) and where in the sequence(s) you're scheduling it (them)?
0 Kudos
dsananes
Level 3

Yest the error exactly is:
Error 1606 could not access network location XXXX
XXXX - The new name that I want to give to the folder.
I also ran a Full MSI Validate Suite and I got one error:
"Possible Mis-Alligned Foreign KeysISIISCommon.1 =
s50IsWebSite.ISIISCommon_ = s72

Parameters of the action:
Directory Name: INSTALLDIR
Directory Value: Company_after_change (No use of property yet...)
Execution Scheduling: Always Execute
Install Exec Sequence: After InstallFinalize
Install Exec Condition: REMOVE=""
0 Kudos
Dan_Galender
Level 10

Try putting it after CostFinalize, use brackets around the property (as in [PropertyName]) for the Directory Value (not the Directory Name), and try the condition "Not Installed" (without quotes).
0 Kudos