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
- :
- Two files with same name?
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
‎Nov 07, 2011
03:32 PM
Renaming and Program Files folder...
During install, we have to rename 64 *or* 32 bit compatible DLLs (depending on Win archtecture) and those files get installed in the "Program Files" folder.
The tough part is, the user may not have sufficient rights to allow renaming files in the "Program Files" folder itself.
So we are interested in ideas that will allow us to rename files during install *before* they arrive in the Program Files folder ...and we are thinking that some sort of trick or workaround or "pre-install" step might be needed.
We have tried things like simple InstallShield script as follows, but insufficient rights will be a problem:
function MyFunction(hMSI)
begin
if (SYSINFO.bIsWow64) then
RenameFile(INSTALLDIR+"\\64_name.dll",INSTALLDIR+"\\generic_name.dll");
endif;
end;
We'd appreciate any recommendations for how to rename files that belong in a potentially read-only folder...
Thanks!
The tough part is, the user may not have sufficient rights to allow renaming files in the "Program Files" folder itself.
So we are interested in ideas that will allow us to rename files during install *before* they arrive in the Program Files folder ...and we are thinking that some sort of trick or workaround or "pre-install" step might be needed.
We have tried things like simple InstallShield script as follows, but insufficient rights will be a problem:
function MyFunction(hMSI)
begin
if (SYSINFO.bIsWow64) then
RenameFile(INSTALLDIR+"\\64_name.dll",INSTALLDIR+"\\generic_name.dll");
endif;
end;
We'd appreciate any recommendations for how to rename files that belong in a potentially read-only folder...
Thanks!
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 07, 2011
07:35 PM
I would recommend having the same filename for both 32- and 64-bit binaries, and installing the components conditionally based on the OS platform.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 08, 2011
09:37 AM
TsungH and others:
We are not familiar with the techniques to do this...could you say a little more?
We are not familiar with the techniques to do this...could you say a little more?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 08, 2011
11:23 AM
I have used a C# custom action to rename the files. Basically you need to write a C# class with just one method that renames the files. Compile this class as a managed DLL and add that as a custom action to your installer project. In my case, the files are predefined and C# code determines the architecture so no need to pass anything from the installer. In case, you need to pass info to the C# custom action, you can always set the MSI Properties and read them in your custom action class.
The second approach much easier now, is the way 'TsungH' suggested. You create two components, one with 64bit assemblies, the other with 32bit assemblies. Select the 64bit Component, go to properties and you can simply set '64-Bit Component' property to Yes. You can use 'SYSINFO.bIsWow64 = 0' condition on 32 bit to ensure it install only when architecture is not 64bit.
I am not sure if you have already looked at this thread.
The second approach much easier now, is the way 'TsungH' suggested. You create two components, one with 64bit assemblies, the other with 32bit assemblies. Select the 64bit Component, go to properties and you can simply set '64-Bit Component' property to Yes. You can use 'SYSINFO.bIsWow64 = 0' condition on 32 bit to ensure it install only when architecture is not 64bit.
I am not sure if you have already looked at this thread.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 08, 2011
05:15 PM
To elaborate further, create 2 sets of components, 1 set for 32-bit, the other for 64-bit. It should follow best practice to have 1 file (exe, ocx, dll, chm or hlp) per component.
Set condition in Coponent Settings to install component conditionally. You will find a list of built-in Windows Installer properties here.
Set condition in Coponent Settings to install component conditionally. You will find a list of built-in Windows Installer properties here.