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:
Either way if the value is not empty then you should have supplied any parameters that are allowed on PPWIZARD's "#option" command (except PUSH/POP & HashPrefix).
Either way if the value is not empty then you should have supplied the new prefix string, see PPWIZARD's "HashPrefix" parameter on it's "#option" command.
Obviously if you did change it then you would need to prefix any imbedded ppwizard commands with the prefix you requested!
You can also use any of the following predefined options:
#define? FILEMAKE_DEFAULT_#OPTIONS_POWERSHELL KeepIndent=YES LeaveBlankLines=YES #define? FILEMAKE_DEFAULT_#OPTIONS ;;Default options if no processing mode specific ones exist. EXAMPLE: KeepIndent=YES LeaveBlankLines=YES AllowPack=NO #define? FILEMAKE_DEFAULT_#OPTION_HashPrefix # #define? FILEMAKE_DEFAULT_#OPTION_HashPrefix_POWERSHELL @# ;;Hash is used as comment character in powershell #define? FILEMAKE_STATEFILE_EXTENSION state.txt ;;What extension will the state file have? #define? FILEMAKE_OUTPUT_DEBUG_INFO_IN_STATEFILE Y ;;"Y" makes it easy to diagnose issues but may at time cause update if MAKEMSI debug output changes etc #define? FILEMAKE_STATECHANGE {@#$FiLeMaKe$#@}- ;;Probably never need to change, can be any code you'd never expect to see in the file
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>^> #)