install vcredist_x86.exe from my installshield seteup

2.2k views Asked by At

im using Installshield 5.0 to create the setup of my application. my application needs the Microsoft Visual C++ 2005 redistributable to be installed On target computer. so i launch the vcredist_x86.exe from mys installshield seteup.rulscript as follow :
sVCREdistprog= sPackSetupDir ^ "\\SetupPack\\vcredist_x86.exe"; if (LaunchAppAndWait (sVCREdistprog, "/q:a", WAIT) < 0) then MessageBox ("Unable to launch: "+ sVCREdistprog+".",WARNING);

this is working fine almost the time. But sometimes it fails ( on WIN7 64 PCs). can any one tell me why it fails and how can i solve this problem?

2

There are 2 answers

2
LucasF On

pWe also install vcredist_x86.exe 2005 on all target computers not as redistributeable but from script like you do. This code works for all Windows OS. We never had a problem with this on over 1000 clients. We used this script since InstallShield 6.0 up to InstallShield 2014.

We put the vcredist_x86.exe in Support Files\Language Independent. On Setup execution this file will be available from SUPPORTDIR.

    sParams = "/q";
    log("  LaunchAppAndWait: " + SUPPORTDIR ^ "vcredist_x86.exe " + sParams);
    nResult = LaunchAppAndWait(SUPPORTDIR ^ "vcredist_x86.exe", sParams, LAAW_OPTION_HIDDEN | LAAW_OPTION_WAIT | LAAW_OPTION_SHOW_HOURGLASS);
    if (nResult < 0) then
        sErrorMessage = FormatMessage(nResult);
        log("**ERROR: Could not start vcredist_x86.exe. Reason: " + sErrorMessage);
    endif;

We have custom log() function. Just ignore this calls to log() or change them to MessageBox or something.

If the constants are not available:

#define LAAW_OPTION_NOWAIT 0x00000000
#define LAAW_OPTION_WAIT 0x00000001
#define LAAW_OPTION_HIDDEN 0x00000002
#define LAAW_OPTION_MINIMIZED 0x00000004
#define LAAW_OPTION_MAXIMIZED 0x00000008
#define LAAW_OPTION_SET_BATCH_INSTALL 0x00000010
#define LAAW_OPTION_SHOW_HOURGLASS 0x00000020
#define LAAW_OPTION_NO_CHANGEDIRECTORY 0x00000040
0
cvechelp On

Create some logfile when running the installation package. If you could not add paramaters to the exe to create the logfile, or you don't know them... you can get the msi of the vcruntime, who is packed inside the VCRuntime.exe.

To do so: launch the exe and when you get the first dialog, goto %TEMP% and get the "GUID" folder of the vcruntime. Inside this folder, the vcruntime msi resides. Copy this to another location because it will be removed again when you stop the current running vcruntime installer.

If you have this msi, you can create a logfile on the problem systems and see what is going wrong. Logging is knowing!

Type msiexec.exe /? for more information about the msi parameters.