cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
DataAnalyzer
Level 8

INSTALLDIR is not C:\Program Files (x86) if user Select C:\Program Files for 32-bit

Our setup program lets users specify the folder to install the program. If they choose C:\program files on a 64-bit system, our INSTALLDIR value is set to that. However, the files get installed in the C:\Program Files (x86) folder. We need the INSTALLDIR variable (or some other variable) to reflect the actual folder name where the file is installed since we need to update registries, shortcuts, etc. to reflect this.

How do we get the actual folder name when InstallShielld makes that change behind the scenes? Thanks.
Labels (1)
0 Kudos
(21) Replies
TurboFisch
Level 7

All x32 programs go into c:\program files (x86).

Don't think you want to mix x32 in the x64 directory.
0 Kudos
DataAnalyzer
Level 8

I agree. But in this case, I'm not specifying the folder name. The user is, and they've specified the wrong folder. InstallShield installs it in the proper folder (x86) which is great, but it doesn't update the INSTALLDIR value which is what the user specified. I need to know what folder the files are being installed in this situation. Is this kept in another variable? Any suggestions?

TurboFisch wrote:
All x32 programs go into c:\program files (x86).

Don't think you want to mix x32 in the x64 directory.
0 Kudos
Roman1
Level 9

Files which are copied by 32-Bit setup go always into c:\program files (x86)

It is so.
0 Kudos
DataAnalyzer
Level 8

Thank you for your response. I agree and understand the X86 folder. I don't have a problem with it being automatically installed in a different folder from what the user selects.

My question is: How do I get the folder name of where it's actually installed? The name differs in different languages and the INSTALLDIR variable doesn't not contain the correct value.

Roman1 wrote:
Files which are copied by 32-Bit setup go always into c:\program files (x86)

It is so.
0 Kudos
MarkusLatz
Level 8

What project type is it Installscript, Basic MSI or InstallScript MSI ?
0 Kudos
DataAnalyzer
Level 8

Installscript

MarkusLatz wrote:
What project type is it Installscript, Basic MSI or InstallScript MSI ?
0 Kudos
MarkusLatz
Level 8

Try to take a look at the user's guide and search for Disable(WOW64FSREDIRECTION). May be this solves your problem.
0 Kudos
DataAnalyzer
Level 8

No, I don't want to disable it. I want the program to go to the right place. And it can be installed anywhere. We let the user choose. However, when they choose C:\Program Files, which is what INSTALLDIR is set to, InstallShield puts it in the x86 folder but doesn't update the INSTALLDIR value. I just need to know where it's actually installed.

MarkusLatz wrote:
Try to take a look at the user's guide and search for Disable(WOW64FSREDIRECTION). May be this solves your problem.
0 Kudos
DataAnalyzer
Level 8

That's actually not true. That's only in English. There are equivalent names in other languages of Windows. What I need is the actual folder name where the files are installed. Any chance of getting that no matter what folder the user selects?

Roman1 wrote:
Files which are copied by 32-Bit setup go always into c:\program files (x86)

It is so.
0 Kudos
DLee65
Level 13

Correct me if I am wrong, but isn't it the Operating system that is substituting the correct path for a 32bit install if the user changes to Program Files. Therefore if the property is reporting C:\Program Files\, I would just use that value because the operating system knows what to do.

I realize that you are using an InstallScript based installation, but in my MSI log files, I see references to where the operating system changes the bit for Program Files.
0 Kudos
DataAnalyzer
Level 8

That may be fine, but I still need that value to put in the registry, create shortcuts and other things that require knowing where the files actually are. Just using the INSTALLDIR value fails. I'm open to suggestions. There's no need to know WHY I need. I just do.

DLee65 wrote:
Correct me if I am wrong, but isn't it the Operating system that is substituting the correct path for a 32bit install if the user changes to Program Files. Therefore if the property is reporting C:\Program Files\, I would just use that value because the operating system knows what to do.

I realize that you are using an InstallScript based installation, but in my MSI log files, I see references to where the operating system changes the bit for Program Files.
0 Kudos
jagadish0911
Level 3

If your installer is 32-bit, the package gets installed in programfiles(x86).
If you want to install it in programfiles, rebuild your installation kit as 64-bit installer.
0 Kudos
DataAnalyzer
Level 8

I think your missing the point of my thread. InstallShield or Windows is automatically installing it in the x86 folder, which is fine by me. What I need is the name of the folder. I'm using INSTALLDIR which is set to Program Files, but the actual folder name includes the x86. We allow people to specify any folder they want and set that value in the registry, create shortcuts, etc. Without the correct folder name, we have problems. Any suggestions welcome.

jagadish0911 wrote:
If your installer is 32-bit, the package gets installed in programfiles(x86).
If you want to install it in programfiles, rebuild your installation kit as 64-bit installer.
0 Kudos
Roman1
Level 9

Just set INSTALLDIR in "General Information" to [ProgramFilesFolder]myOffice\
and bevore Installation ends put INSTALLDIR to registry.
0 Kudos
DLee65
Level 13

I can appreciate your situation. The situation is complicated by the fact that you are dealing with multiple languages and C:\Program Files may be C:\Programme Files\ or some other version.

How about if you put a check in to prevent a user from specifying the wrong folder.
If OS is x64 and user specifies any path in C:\Program Files\ then issue a message stating the problem to the end user and specify how to correct it.
You should be able to specify the path C:\Program Files programmatically so that you do not have to worry about the spelling of the path. You may need to use the bit that tells the script to use the 64bit path instead of transforming it to the 32bit path.

The installer by default should never specify this path, why a user would want to install there is beyond me, but if this is a problem with those who use the application then just prevent the problem in the first place.
0 Kudos
DataAnalyzer
Level 8

I think you're missing the problem.

We give the user the ability to specify any folder they want to install the program. We default to the PROGRAM FILES folder. Using the standard dialog, the value the user selects gets assigned to INSTALLDIR.

Unfortunately, that variable doesn't hold the actual folder name in this situation, so when it gets put in the registry, the value is not the actual folder name. All I'm trying to do is to get the actual folder name. I don't want to prevent the user from specifying the folder. If they choose a folder that's not the PROGRAM FILES folder, this isn't a problem.

Roman1 wrote:
Just set INSTALLDIR in "General Information" to [ProgramFilesFolder]myOffice\
and before Installation ends put INSTALLDIR to registry.
0 Kudos
DataAnalyzer
Level 8

Rather than do all this, is there an alternative to the INSTALLDIR variable that holds the correct value? Somewhere within IS, it knows the correct location that's different from what it has assigned to INSTALLDIR.

It doesn't seem to make sense to bother the user with a prompt since they haven't done anything wrong. The installer does the appropriate thing and installs it properly. All I need is a reliable way to know where.

DLee65 wrote:
I can appreciate your situation. The situation is complicated by the fact that you are dealing with multiple languages and C:\Program Files may be C:\Programme Files\ or some other version.

How about if you put a check in to prevent a user from specifying the wrong folder.
If OS is x64 and user specifies any path in C:\Program Files\ then issue a message stating the problem to the end user and specify how to correct it.
You should be able to specify the path C:\Program Files programmatically so that you do not have to worry about the spelling of the path. You may need to use the bit that tells the script to use the 64bit path instead of transforming it to the 32bit path.

The installer by default should never specify this path, why a user would want to install there is beyond me, but if this is a problem with those who use the application then just prevent the problem in the first place.
0 Kudos
Roman1
Level 9

Normally, INSTALLDIR has always the path, which does user pick.
Just for fun, put on the last dialog ReadyToInstall a text field with Text "[INSTALLDIR]".
You will see what is the actual installation target.

Is your project msi? Are you using ISScript custom actions?
0 Kudos
DataAnalyzer
Level 8

Using ISScript custom actions. INSTALLDIR shows the Program Files folder, but the actual folder includes the x86. That's the inconsistency I'm trying to address.

Roman1 wrote:
Normally, INSTALLDIR has always the path, which does user pick.
Just for fun, put on the last dialog ReadyToInstall a text field with Text "[INSTALLDIR]".
You will see what is the actual installation target.

Is your project msi? Are you using ISScript custom actions?
0 Kudos
Roman1
Level 9

Please try to get INSTALLDIR using:

nValueBuf = 256;
MsiGetProperty(hMSI, "INSTALLDIR" , szInstalldir, nValueBuf);

Be careful, is the CA deferred, you have to get INSTALLDIR using

MsiGetProperty(hMSI,"CustomActionData",szInstalldir,nValueBuf);

Of course, CustomActionData must be set.

http://forum.installsite.net/index.php?showtopic=20780
0 Kudos