Solved

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

Posted on 2006-06-16
5
908 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Ok I have been working on this for some time having learned and gained certification in XenDesktop 4 along came version 5 which was released last month. Since then I have been working to deploy XenDesktop 5 in a small environment with only 2 virt…
I have been scripting applications way too long and can never remember how to create an ISS file.  So I decided to write this article to act as my own knowledge base for future reference, and hope you will also benefit. An ISS file is a response …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

749 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