MAKEMSI quickly and reliably creates MSI files in a non-programmatic way
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
[Bottom][Contents][Prev]: TryMeUseMergeModule.MM[Next]: TryMeWithFixedGuids.MM
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->MAKEMSI Installs...->Samples Installed by MAKEMSI->Samples - Build New MSI/MSM->TryMeUserInputUsed2CreateFile.mm

TryMeUserInputUsed2CreateFile.mm

This is one of the MAKEMSI samples which build a new MSI/MSM. This MSI makes use of these "TryMe.MM" files:

  1. TryMe.ver
  2. TryMe.rtf

This sample takes user input from the person performing the build and creates a file with contents based on this input for inclusion in the generated msi.

;----------------------------------------------------------------------------
;    MODULE NAME:   TryMeUserInputUsed2CreateFile.mm
;
;        $Author:   USER "Dennis"  $
;      $Revision:   1.1  $
;          $Date:   19 Nov 2007 19:28:58  $
;       $Logfile:   C:/DBAREIS/Projects.PVCS/Win32/MakeMsi/TryMeUserInputUsed2CreateFile.mm.pvcs  $
;
; DESCRIPTION
; ~~~~~~~~~~~
; Takes user input (AT BUILD TIME), does this before loading MAKEMSi so
; as to be quick and allow speedy cancellation if user changes mind etc.
;
; You could get much more fancy about how to prompt for the data, for example
; could be a small html application (.hta).
;----------------------------------------------------------------------------


;----------------------------------------------------------------------------
;--- Get user input (user prompted, but can come from cmd line etc) ---------
;----------------------------------------------------------------------------
#DefineRexx ''
    ;--- Ask for the info ---------------------------------------------------
    call Say ""
    call Say ""
    call Say "NEED CUSTOMERS DETAILS"
    call Say "~~~~~~~~~~~~~~~~~~~~~~"
    call Charout '<stdout>', 'Customer Name : '
    CustomerName = linein('<stdin>');
    call Say2Logs 'CustomerName = "' || CustomerName || '"'
    if CustomerName = '' then
       error 'Build aborted as no customer name supplied';
    call Say ""
    call Say ""

    ;--- Categorise the customer based on what the name is ------------------
    if ToUpperCase(CustomerName) = 'IMPORTANT' then
       CustomerType = "a big wig"
    else
       CustomerType = "small fry"
#DefineRexx


;----------------------------------------------------------------------------
;--- Include MAKEMSI support (with my customisations and MSI branding) ------
;----------------------------------------------------------------------------
#define VER_FILENAME.VER  TryMe.Ver      ;;I only want one VER file for all samples! (this line not actually required in "tryme.mm")
#include "ME.MMH"


;----------------------------------------------------------------------------
;--- Create the file (contents vary by customer) ----------------------------
;----------------------------------------------------------------------------
<$FileMake "out\Customer.dat">
    This data file is for "<??CustomerName>" and was created <?CompileTime>
    by <??*UserName>.

    <?NewLine>
    This customer is <??CustomerType>...
<$/FileMake>

;----------------------------------------------------------------------------
;--- Define default location where file should install and add files --------
;----------------------------------------------------------------------------
<$DirectoryTree Key="INSTALLDIR" Dir="[ProgramFilesFolder]\<$ProdInfo.ProductName>" CHANGE="\" PrimaryFolder="Y">
<$Files "out\Customer.dat" DestDir="INSTALLDIR">


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: TryMeUseMergeModule.MM[Next]: TryMeWithFixedGuids.MM


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Sunday August 13 2017 at 2:39pm
Visit MAKEMSI's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.