Solved

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

Posted on 2006-06-16
5
909 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

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 …
If your system is showing symptoms of browser hijacks or 'google search redirects' check out my other article (http://rdsrc.us/u3GP7A) first and run the tool TDSSKiller (http://rdsrc.us/GDBBs4) to get rid of the infection. Once done, and if the …
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…

737 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