Solved

How can my InstallShield program detect if Microsoft Installer is required?

Posted on 2006-06-16
5
899 Views
Last Modified: 2013-11-14
I am deploying a .NET application, and want my Installshield program to check dependencies.   They are as follows;  My.NETapplication -> .NET 2.0 Framework -> Microsoft Installer 3.0+.  I can detect if .NET 2.0 Framework is installed, but I can't figure out what to look for to make sure that MSI 3.0+ is there.  I am hoping for a solution general enough that it works for Windows XP and Windows 2000.
0
Comment
Question by:GSIJoe
  • 3
  • 2
5 Comments
 
LVL 86

Assisted Solution

by:jkr
jkr earned 500 total points
Comment Utility
You can determine that by reading the version info resource from 'msi.dll'. See e.g. http://support.microsoft.com/kb/167597/EN-US/ ("SAMPLE: GetVers.exe Specifies Component FileVersion and #Version")
0
 

Author Comment

by:GSIJoe
Comment Utility
That sounds perfectly plausible ... not sure why I didn't think of it myself.   Alas it is after 5:00 Friday, so I won't be able to check it out until Monday.  In the mean time, if someone can give hints on how to do this from within InstallShield, I will dole out some assisted points.
0
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
Comment Utility
See http://helpnet.installshield.com/robo/projects/devstudio9helplangref/LangrefVerGetFileVersion.htm ("VerGetFileVersion") and http://helpnet.installshield.com/robo/projects/devstudio9helplangref/LangrefVerGetFileVersion_example.htm ("VerGetFileVersion Example"):

/*--------------------------------------------------------------*\
 *
 * InstallShield Example Script
 *
 * Demonstrates the VerGetFileVersion function.
 *
 * The script below calls VerGetFileVersion to retrieve the
 * version number of the Windows Notepad.  The information is
 * displayed in a message box.
 *
\*--------------------------------------------------------------*/

#define EXAMPLE_FILE WINDIR ^ "NotePad.exe"
#define TITLE_TEXT "VerGetFileVersion Example"

// Include Ifx.h for built-in InstallScript function prototypes.
#include "Ifx.h"

      export prototype ExFn_VerGetFileVersion(HWND);

function ExFn_VerGetFileVersion(hMSI)
    NUMBER nResult;
    STRING szFile, szPath, szMsg, svVersionNumber;
begin

    // Get the version number of the specified file.
    nResult = VerGetFileVersion(EXAMPLE_FILE, svVersionNumber);

    // Report the results of VerGetFileVersion.
    if (nResult = FILE_NO_VERSION) then
        szMsg = EXAMPLE_FILE + " does not contain version information.";
        MessageBox (szMsg, INFORMATION);
    elseif (nResult = FILE_NOT_FOUND) then
        szMsg = EXAMPLE_FILE + " could not be found.";
        MessageBox (szMsg, INFORMATION);
    else
        szMsg    = "The version number of %s is %s";
        SprintfBox (INFORMATION, TITLE_TEXT, szMsg,
                   EXAMPLE_FILE, svVersionNumber);
    endif;

end;

(WOW, I am really happy that I don't have to use InstallScript any more ;o)
0
 

Author Comment

by:GSIJoe
Comment Utility
Well, I have to do use INstallShield about once every two years ... and forget most everything in the mean time!


0
 
LVL 86

Expert Comment

by:jkr
Comment Utility
/me definitly prefers C++ ;o)
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Among others, I monitor the Windows Installer zone and Installer zone. I find that many of the questions could be answered much more quickly if a Windows Installer verbose log were submitted with the question.   However, I do not always have t…
If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now