This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Rename a Folder
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 01, 2012
08:47 PM
Rename a Folder
This should be simple and probably is. But I've spent all day with nothing but failure, hopefully someone can set me straight.
I need to be able to install the same set of files to a different location depending on the OS that's running on the target machine and whether it's the 32 bit or 64 bit version of the app that's being installed. For example, if installing a 32 bit version of the app on 64 bit windows then the files need to be placed in [CommonAppDataFolder]MyData (x86)\Config. If installing the 64 bit version of the app on 64 bit windows then the files need to be placed in [CommonAppDataFolder]MyData\Config.
The approach I've been pursuing is to create the MyData and Config folders under [CommonAppDataFolder] and then place all the installable files in these folders (they come from a huge number of components). Then I tried to use a "Set Directory" custom action to rename the MyData folder to MyData (x86) when I detected that I was installing the 32 bit version of the app on 64 bit Windows.
This seemed straight forward but I've had no luck. I've gotten a combination of errors depending on when I scheduled the execution of the CA and absolutely nothing has worked. I'm executing the CA "only once" but have included it in both the UI sequence and the Exec sequence. I've sequenced it "after CostFinalize" in both cases.
Further, I'm now at a point where I can't even uninstall it as I'm getting an "error 2343: Specified path is empty" message.
Can anyone help me with understanding a simple way to perform this simple function - basically renaming a folder.
Thanks!
I need to be able to install the same set of files to a different location depending on the OS that's running on the target machine and whether it's the 32 bit or 64 bit version of the app that's being installed. For example, if installing a 32 bit version of the app on 64 bit windows then the files need to be placed in [CommonAppDataFolder]MyData (x86)\Config. If installing the 64 bit version of the app on 64 bit windows then the files need to be placed in [CommonAppDataFolder]MyData\Config.
The approach I've been pursuing is to create the MyData and Config folders under [CommonAppDataFolder] and then place all the installable files in these folders (they come from a huge number of components). Then I tried to use a "Set Directory" custom action to rename the MyData folder to MyData (x86) when I detected that I was installing the 32 bit version of the app on 64 bit Windows.
This seemed straight forward but I've had no luck. I've gotten a combination of errors depending on when I scheduled the execution of the CA and absolutely nothing has worked. I'm executing the CA "only once" but have included it in both the UI sequence and the Exec sequence. I've sequenced it "after CostFinalize" in both cases.
Further, I'm now at a point where I can't even uninstall it as I'm getting an "error 2343: Specified path is empty" message.
Can anyone help me with understanding a simple way to perform this simple function - basically renaming a folder.
Thanks!
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 06, 2012
02:17 AM
Hello. gcggcg.
Sorry for if you already knew this...
First of all, do you know you can not create MSI package which supports both x86 and x64 environment?
http://msdn.microsoft.com/en-us/library/windows/desktop/aa367451(v=vs.85).aspx
For this reason, you may have to redesign your installer.
Sorry for if you already knew this...
First of all, do you know you can not create MSI package which supports both x86 and x64 environment?
http://msdn.microsoft.com/en-us/library/windows/desktop/aa367451(v=vs.85).aspx
For this reason, you may have to redesign your installer.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 08, 2012
10:22 AM
UG - forget about the Custom Actions and renaming a Directory - gets tricky.
Just create 2 different components with the same files with different Install locations and use a condition on the component:
Destination = [CommonAppDataFolder]MyData (x86)\Config.
Condition = NOT VersionNT64
Destination = [CommonAppDataFolder]MyData\Config.
Condition = VersionNT64
Just create 2 different components with the same files with different Install locations and use a condition on the component:
Destination = [CommonAppDataFolder]MyData (x86)\Config.
Condition = NOT VersionNT64
Destination = [CommonAppDataFolder]MyData\Config.
Condition = VersionNT64
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 08, 2012
11:12 AM
Hi enanrum,
Thanks for the reply! I was able to find a way to do it with Custom Actions and, yes, it was tricky. This is a huge installer (9000+ files, 600 components, etc.). I had actually thought about your suggestion early on as a very good way to do it but it turns out that the number of files and components involved were just too many to make it practical.
Here's what ended up working for me:
- Create a folder named MyData in [CommonAppDataFolder]
- Create the Config folder in MyData
- Look at the directory table and get the identifier for the MyData folder(make it all uppercase if it isn't already)
- Create a public property that has the same name as this directory identifier
- Make sure that the value of this public property is null (delete the value)
- Create a "Set Property" custom action that references the public property
- In that custom action create a condition that is true when installing the 32 bit version of the product on 64 bit Windows (ISReleaseFlags><"32BitVersion" And VersionNT64)
- When this condition is true set the value of the property to [CommonAppDataFolder]MyData (x86)
- I ran this in both the UI Sequence and the Execute sequence and set it to "Execute only once".
This worked but, as you said, it is tricky, undocumented and a PITA for something so simple as renaming a directory at run time. It's not that it's all that difficult once you figure out what to do, it's that, to my knowledge, it's not documented anywhere so you're left to just wonder and experiment until you stumble upon something that works. You'd think InstallShield would have a built in CA for something like this or at least document it clearly somewhere.
Thanks for the reply! I was able to find a way to do it with Custom Actions and, yes, it was tricky. This is a huge installer (9000+ files, 600 components, etc.). I had actually thought about your suggestion early on as a very good way to do it but it turns out that the number of files and components involved were just too many to make it practical.
Here's what ended up working for me:
- Create a folder named MyData in [CommonAppDataFolder]
- Create the Config folder in MyData
- Look at the directory table and get the identifier for the MyData folder(make it all uppercase if it isn't already)
- Create a public property that has the same name as this directory identifier
- Make sure that the value of this public property is null (delete the value)
- Create a "Set Property" custom action that references the public property
- In that custom action create a condition that is true when installing the 32 bit version of the product on 64 bit Windows (ISReleaseFlags><"32BitVersion" And VersionNT64)
- When this condition is true set the value of the property to [CommonAppDataFolder]MyData (x86)
- I ran this in both the UI Sequence and the Execute sequence and set it to "Execute only once".
This worked but, as you said, it is tricky, undocumented and a PITA for something so simple as renaming a directory at run time. It's not that it's all that difficult once you figure out what to do, it's that, to my knowledge, it's not documented anywhere so you're left to just wonder and experiment until you stumble upon something that works. You'd think InstallShield would have a built in CA for something like this or at least document it clearly somewhere.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 20, 2012
10:01 AM
Good info. For those interested, this is also how you would install a component to a requested destination from a Custom Dialog, ie; I had to copy some files to a Siebel Server.
Another way rather than looking at the Directory Table is:
- "Application Data"->"Files and Folders"
- R-Click "Destination Computer" -> "Show Predefined Folders" and select the [CommonAppDataFolder] (CADF)
- R-Click CADF and Add your folder name under it - MyData
- R-Click on new folder and get the Directory Identifier - you can also rename it here to something more descriptive.
For the component that you want to change - use this Identifier for the Destination of the Component.
Setup the Set Property Custom Action. You can also run this CA in the Next Button of a Custom Dialog.
Another way rather than looking at the Directory Table is:
- "Application Data"->"Files and Folders"
- R-Click "Destination Computer" -> "Show Predefined Folders" and select the [CommonAppDataFolder] (CADF)
- R-Click CADF and Add your folder name under it - MyData
- R-Click on new folder and get the Directory Identifier - you can also rename it here to something more descriptive.
For the component that you want to change - use this Identifier for the Destination of the Component.
Setup the Set Property Custom Action. You can also run this CA in the Next Button of a Custom Dialog.