eWorld.UI - Matt Hawley

Ramblings of Matt

Custom NSIS Macros

February 6, 2004 20:17 by matthaw

I was asked to provide my scripts that allow me to check for the .NET framework using NSIS.  I'll do one step better, I'll post my custom macros (downloadable of course) that will allow you to plug them right into your NSIS scripts and run required tasks.  Below is a brief introduction to each of the macros, this is so you'll know how to use them mainly:

  • eWorld_DetectNetFramework_10: This macro, as the name states, detects the .NET framework v1.0...but due to backwards compatability, it first checks for at least v1.1 of the .NET framework.  If either of the 2 frameworks are not found, the user is prompted and the installation quits.  This macro should be run in the .onInit function of your script, and only when you're installing assemblies compiled under the 1.0 framework.
  • eWorld_DetectNetFramework_11: Like its brother macro above, this will only detect for the v1.1 framework.  If the 1.1 framework is not found, the user is prompted, and the installation quits.  This macro should be run in the .onInit function of your script, and only when you're installing assemblies compiled under the 1.1 framework.
  • eWorld_DetectPreviousVersion: This will detect a previous version that is installed based on the registry key HKLM \ Software \ {APPLICATION NAME}.  It will also detect if a MSI is installed with a particular application name.  This macro takes 2 parameters, APPNAME and MSIAPPNAME.  If you pass in an empty string for MSIAPPNAME, it will not check for MSI applications.  If this macro detects a previous installation, it will prompt the user to uninstall it.  At this point, it will write a temporary file to note that it is currently uninstalling...then it will launch the uninstaller of the previous version.  This should be used in conjunction with eWorld_LaunchInstaller.  This macro should be run in the .onInit function of your script.
  • eWorld_LaunchInstaller: This will remove the temporary uninstall file created by eWorld_DetectPreviousVersion, and will launch the installer.  This macro should be called as the last step in your Uninstall function.

There are a few other macros in this script file, however they're called from the macros listed above, and should not be used in any other manner.

Download the Macros!



Categories: General
Actions: E-mail | Permalink | Comments (2) | Comment RSSRSS comment feed

Comments

February 6. 2004 22:37

Awesome, thanks for sharing.

http://

May 3. 2004 23:39

Thanks for sharing!

Ulve

Comments are closed

Copyright © 2000 - 2024 , Excentrics World