Script or MI that runs based on 64 or 32 bit
This little batch file scriptlet will allow you to run a command based on architecture:
set ProgFiles86Root=%ProgramFiles(x86)%
IF NOT "%ProgFiles86Root%"=="" (
vcredist_x64.exe /q /norestart
) ELSE (
vcredist_x86.exe /q /norestart
)
As you can see replacing the vcredist_x64.exe /q /norestart with another command specific to 64 bit will run if it finds a Program Files (x86). Else, it runs the next command that would be 32bit.
There may be a more elegant way of doing it, but here ya go anyway. Plop this in a batch file and set it as an MI and you are able to have only one MI for both architectures.
set ProgFiles86Root=%ProgramFiles(x86)%
IF NOT "%ProgFiles86Root%"=="" (
vcredist_x64.exe /q /norestart
) ELSE (
vcredist_x86.exe /q /norestart
)
As you can see replacing the vcredist_x64.exe /q /norestart with another command specific to 64 bit will run if it finds a Program Files (x86). Else, it runs the next command that would be 32bit.
There may be a more elegant way of doing it, but here ya go anyway. Plop this in a batch file and set it as an MI and you are able to have only one MI for both architectures.
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
cmccracken
13 years ago
Posted by:
snissen
13 years ago
Batch files are scripts run by cmd.exe. But which cmd.exe: the one in %SystemRoot%\system32, the one in %SystemRoot%\SysWOW64, or the one in %SystemRoot%\sysnative? It does matter! Windows tries very hard to hide the 64-bit environment when you run a 32-bit executable.
I was totally baffled by these differences until I attended this one day online class:
http://csi-windows.com/courses/windows64bit
Need some convincing? I found these two blogs useful:
http://csi-windows.com/toolkit/csi-getosbits and
http://csi-windows.com/blog/all/27-csi-news-general/263-how-windows-installer-processes-packages-on-64-bit-windows
I highly recommend Darwin's insights. Sande
I was totally baffled by these differences until I attended this one day online class:
http://csi-windows.com/courses/windows64bit
Need some convincing? I found these two blogs useful:
http://csi-windows.com/toolkit/csi-getosbits and
http://csi-windows.com/blog/all/27-csi-news-general/263-how-windows-installer-processes-packages-on-64-bit-windows
I highly recommend Darwin's insights. Sande
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.