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]: FileFind[Next]: FileMakeIgnore
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Source Code->Commands->FileMake

The "FileMake" Command

This command (which can't be nested) is used to define the start of a file that you wish to build as part of your scripts processing (build time not installation time!). The end of the file is indicated by the "/FileMake" command.

PPWIZARD has a "#output" command which can be used for this purpose, the reason you'd use the "FileMake" command instead is that it will not overwrite any existing file if there has been no significant change (what is significant is defined by you - see the "FileMakeIgnore" command).

Any file header produced automatically by default (or your configuration) is treated as insignificant as it typically contains file or time details, if it is significant then you need to use the "#output" command instead.

I do not like file timestamps and MD5 information to change just because I am generating a new version of an MSI. If I am looking for differences between two versions of the same MSI to try and diagnose a problem I do not want to be confused or distracted by these trivial file changes and I don't wish to see these trivial changes alter the file information in the HTML report.

This command takes these parameters:

EXAMPLE - 1

;--- Start the VBS (need to ignore the automatically generated header) ------
<$FileMake "<$MAKEMSI_VBSCRIPT_DIR>\VbsToBeInstalled.VBS">
    ;--- The contents of the VBSCRIPT ---------------------------------------
    <?SyntaxCheck>                      ;;Syntax check the generated code

    ;--- Some Code ----------------------------------------------------------
    SomeTime = "<$FileMakeIgnore><?CompileTime><$/FileMakeIgnore>"   ;;Actual time value does not significantly affect outcome of this script (its more like a version stamp)
    wscript.echo "Hi there, some VBS here!" & vbCRLF & vbCRLF & "SomeTime is " & SomeTime
<$/FileMake>

EXAMPLE - My "ReadMe" macros

;----------------------------------------------------------------------------
;--- ReadMe Macros (creates and adds readme.txt to current component) -------
;----------------------------------------------------------------------------
#(
    ;--- Define README start macro ------------------------------------------
    #define ReadMe

    ;--- Open the output file (following lines placed in the file) ----------
    #define+ @@ReadmeName  <$MAKEMSI_OUT_LOG_DIR_RELATIVE>\ReadmeFiles\Readme-<$Component?>.TXT  ;;Only once per-component!
    #define+ @@IsKeyFile   {$KeyFile=^N^}
    <$FileMake "<$@@ReadmeName>">

    ;--- Want to keep blank lines! ------------------------------------------
    #option  PUSH LeaveBlankLines=ON

    ;--- You add readme text lines between the "<$readme>" and  "<$/readme>" tags ---
#)
#(
    ;--- Define README end macro --------------------------------------------
    #define /ReadMe

    ;--- Restore options to original state ----------------------------------
    #option  POP

    ;--- Close the file -----------------------------------------------------
    <$/FileMake>

    ;--- Add the file to the current component ------------------------------
    <$File Source="<$@@ReadmeName>" Destination="{$Destination=^ReadMe.TXT^}" KEYPATH=^<$@@IsKeyFile>^>
#)


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]: FileFind[Next]: FileMakeIgnore


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Sunday February 28 2016 at 3:45pm
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.