Solved

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

Posted on 2006-06-16
5
903 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
ID: 16923241
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
ID: 16923716
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
ID: 16927293
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
ID: 16942483
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
ID: 16948290
/me definitly prefers C++ ;o)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is only natural that we all want our PCs to be in good working order, improved system performance, so that is exactly how programs are advertised to entice. They say things like:            •      PC crashes? Get registry cleaner to repair it!    …
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 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

16 Experts available now in Live!

Get 1:1 Help Now