|
![]() |
| COMPANY.MMH |
Automatically included by "DEPT.MMH", see "Preferred MSI Interface for Building a Complete MSI" for more details...
As a lot of the manipulation this header performs is to "tweek" the Microsoft supplied "uisample.msi", I have created the "UISAMPLE.MMH" header to keep the bulk of these together.
;----------------------------------------------------------------------------
;
; MODULE NAME: COMPANY.MMH
;
; $Author: USER "Dennis" $
; $Revision: 1.88 $
; $Date: 23 Aug 2008 14:19:42 $
; $Logfile: C:/DBAREIS/Projects.PVCS/Win32/MakeMsi/Company.mmh.pvcs $
; COPYRIGHT: (C)opyright Dennis Bareis, Australia, 2003
; All rights reserved.
;
; Note that this header is one of the few intended to be "replaced".
; It has however been written so physical altering or deleting of this
; file should not be required.
;
; There are many options, some are:
;
; 1. Ignore this file altogether, create your own front end with
; different filenames so as not to clash.
;
; 2. Modify this file BUT if you do so you should move it to a
; different directory so as not be be deleted ALONG WITH YOUR
; CHANGES on a MAKEMSI uninstall!
;
; 3. Create a new header that overrides some things but still includes
; this one.
;
; Let me know of any issues.
;----------------------------------------------------------------------------
;----------------------------------------------------------------------------
;--- Define Version number of this install support --------------------------
;----------------------------------------------------------------------------
#ifdef COMPANY_VERSION
;--- Die, already included -----------------------------------------------
#error ^You have already included "<?InputComponent>"^
#endif
#define COMPANY_VERSION 08.202
;----------------------------------------------------------------------------
;--- Create our own namespace -----------------------------------------------
;----------------------------------------------------------------------------
#NextId
#NextId LOCK "COMPANY.MMH"
;----------------------------------------------------------------------------
;--- Does this actually look like Dennis' Development box? ------------------
;----------------------------------------------------------------------------
#if ['<??*PRJ_INST_PATH?>' <> '']
;--- My company.mmh etc NOT JUST A SAMPLE! -------------------------------
#define IsMyBox
#endif
;----------------------------------------------------------------------------
;--- Define some company Information ----------------------------------------
;----------------------------------------------------------------------------
#define? COMPANY_NAME My Company
;----------------------------------------------------------------------------
;--- License Options --------------------------------------------------------
;----------------------------------------------------------------------------
;###[ListedInDoco-LookForLicenceFileOptions]###
#define? COMPANY_LICENCE_SPELLING_C_OR_S c ;;Spelling - Licence OR License?
#define? COMPANY_LOOK_FOR_LICENCE_FILE Y ;;Y/N - Look for file or just use if supplied?
#define? COMPANY_PREPROCESS_LICENCE_FILE N ;;Y/N - Does sthe file contain macros or decisions etc?
#define? COMPANY_LICENCE_EXTN .licen<$COMPANY_LICENCE_SPELLING_C_OR_S>e.rtf ;;US spelling?
#define? COMPANY_LICENCE_NAME <?InputFile $$FilePart:w><$COMPANY_LICENCE_EXTN>
;###[ListedInDoco-LookForLicenceFileOptions]###
#define? UISAMPLE_LICENCE_SPELLING_C_OR_S <$COMPANY_LICENCE_SPELLING_C_OR_S>
;----------------------------------------------------------------------------
;--- Modify product info keywords for .VER file ----------------------------
;----------------------------------------------------------------------------
#ifndef VER_PRODINFO_VALID_KEYWORD_LIST_EXTRA
;--- Extra "prodinfo" KeyWords -------------------------------------------
#define? COMPANY_PRODINFO_VALID_KEYWORD_LIST_EXTRA
#( ""
#define VER_PRODINFO_VALID_KEYWORD_LIST_EXTRA
,UpgradeCodes ;;A list of EXTRA upgrade codes
,MsiName ;;Short name of MSI (no extension)
,Licence ;;If not supplied then disabled, if starts with "@" then file name follows.
;--- If supplied must begin with a comma -----------------------------
<$COMPANY_PRODINFO_VALID_KEYWORD_LIST_EXTRA>
#)
;--- Define any "prodinfo" default values --------------------------------
#define? ProdInfo.Default.UpgradeCodes
#define? ProdInfo.Default.Licence
#define? ProdInfo.Default.MsiName <$ProdInfo.ProductName><$ProductVersion>
#endif
;----------------------------------------------------------------------------
;--- Add Supported platform details to HTML report's summary ----------------
;----------------------------------------------------------------------------
#define? COMPANY_HTMLSUMM_AFTER_SUPPORTED_PLATFORMS
#define? HTMLSUMM_SUPPORTED_PLATFORMS_TT \
<$HTMLRPT_TT 'This lists platforms we support this product on.'>
#define? COMPANY_HTMLSUMM_SUPPORTED_PLATFORMS_BEFORE_LIST
#if ['<$DEPT_SUPPORT_WEB_URL $$IsBlank>' = 'Y']
#define? COMPANY_HTMLSUMM_SUPPORTED_PLATFORMS_AFTER_LIST
#elseif
#(
#define? COMPANY_HTMLSUMM_SUPPORTED_PLATFORMS_AFTER_LIST
Support can be obtained from
"<a href='<$DEPT_SUPPORT_WEB_URL>' title='click to visit the support website' target='_blank'><$DEPT_SUPPORT_WEB_URL></a>".
#)
#endif
#( ''
#define? HTMLSUMM_AFTER_BUILT_AT
<TR<$HTMLSUMM_SUPPORTED_PLATFORMS_TT>>
<TD align="center">
Supported<BR>Platforms
</TD>
<TD>
<$COMPANY_HTMLSUMM_SUPPORTED_PLATFORMS_BEFORE_LIST>
<$PLATFORM_MsiSupportedWhereHtml>
<$COMPANY_HTMLSUMM_SUPPORTED_PLATFORMS_AFTER_LIST>
</TD>
</TR>
<$COMPANY_HTMLSUMM_AFTER_SUPPORTED_PLATFORMS>
#)
;----------------------------------------------------------------------------
;--- Change way MSI comments are used --------------------------------------
;----------------------------------------------------------------------------
#define? COMPANY_PACKAGED_BY Packaged by <$DEPT_NAME> (<$COMPANY_NAME> - <$DEPT_ADDRESS>).
#( ''
;--- This can be long but need CRLF for XP bug workaround ----------------
#define? COMPANY_PROPERTY_ARPCOMMENTS
<$ProdInfo.Productname> (<$ProductVersion>)<$CRLF>
was created <?CompileTime>.<$CRLF><$CRLF>
<$ProdInfo.Description><$CRLF>
<$COMPANY_PACKAGED_BY><$CRLF><$CRLF>
<$PLATFORM_MsiSupportedWhere>
#)
;----------------------------------------------------------------------------
;--- Load MAKEMSI support ---------------------------------------------------
;----------------------------------------------------------------------------
#define HTMLRPT_SHOW_EMPTY_REPORTS N ;;Show reports for "null" entries!
#NextId PUSH
#include "MakeMsi.MMH"
#NextId POP
;----------------------------------------------------------------------------------------
;--- Allow you to easily "mark" an MSI files as being in a specific mode (test maybe) ---
;----------------------------------------------------------------------------------------
#define? COMPANY_MSINAME_PREFIX
#define? COMPANY_MSINAME_SUFFIX
#option PUSH DefineMacroReplace=YES
#define+ ProdInfo.MsiName <$COMPANY_MSINAME_PREFIX><$ProdInfo.MsiName><$COMPANY_MSINAME_SUFFIX>
#option POP
;----------------------------------------------------------------------------
;--- Define platforms -------------------------------------------------------
;----------------------------------------------------------------------------
#define? COMPANY_DEFINE_DEPARTMENTS_PLATFORMS
<$COMPANY_DEFINE_DEPARTMENTS_PLATFORMS> ;;Define them
<$PlatformProcessing> ;;Thats all of them!
;----------------------------------------------------------------------------
;--- Start the Package (use template) ---------------------------------------
;----------------------------------------------------------------------------
#define? COMPANY_MSI_TEMPLATE_FILENAME <??*MAKEMSI_DIR>UISAMPLE.msi ;;Contents of "MAKEMSI_DIR" ends with a slash!
#(
;--- Allow user to use another method for getting template data ----------
#define? COMPANY_GET_TEMPLATE_AND_OPEN_MSI
<$Msi "<$ProdInfo.MsiName>.msi" Template="<$COMPANY_MSI_TEMPLATE_FILENAME>">
#)
#define? COMPANY_IMMEDIATELY_AFTER_TEMPLATE_MSI_OPENED
<$COMPANY_GET_TEMPLATE_AND_OPEN_MSI>
<$COMPANY_IMMEDIATELY_AFTER_TEMPLATE_MSI_OPENED>
;---[4Doco-OptionalResolveSourceInsertion]---
;----------------------------------------------------------------------------
;--- Add "ResolveSource" action ---------------------------------------------
;----------------------------------------------------------------------------
#define? COMPANY_INSERT_ResolveSourceAction N
#if ['<$COMPANY_INSERT_ResolveSourceAction>' = 'Y']
;--- We do wish to insert the "ResolveSource" action --------------------
#define COMPANY_RESOLVE_SOURCE_CONDITION <$CONDITION_EXCEPT_UNINSTALL>
#(
#define ResolveSource ;;Note that the SOURCE MSI MUST BE AVAILABLE (for example can't eneter maintenance mode if MSI gone...)
<$Table "{$#1}">
#(
;--- Need to do this or "SourceDir" null if UI=none or basic --------
#ifndef @@RsSeqNumber
;--- Only declare variable once ---------------------------------
dim RsSeqNumber<?NewLine>
#define @@RsSeqNumber
#endif
RsSeqNumber = GetSeqNumber("{$#1}", "CostInitialize-CostFinalize", 1)
<$Row
Action="ResolveSource" ;;Set up the "sourceDir" property/directory
Condition=^<$COMPANY_RESOLVE_SOURCE_CONDITION>^ ;;Don't want during uninstall etc (may require source media, CD etc)
*Sequence=^RsSeqNumber^ ;;Use Sequence number determined earlier
>
#)
<$/Table>
#)
<$ResolveSource "InstallUISequence">
<$ResolveSource "InstallExecuteSequence">
#endif
;---[4Doco-OptionalResolveSourceInsertion]---
;----------------------------------------------------------------------------------------
;--- Note ORCA bug has caused invalid value for security in the (UISAMPLE) template -----
;----------------------------------------------------------------------------------------
#define? COMPANY_SECURITY_VALUE_VBEXP PidSecurityNoRestriction ;;VB expression (empty to turn off)
#if ['<$COMPANY_SECURITY_VALUE_VBEXP>' <> '']
;--- Updating of the security "property" not disabled -------------------
<$Summary "Security" *Value=^<$COMPANY_SECURITY_VALUE_VBEXP>^>
#endif
;----------------------------------------------------------------------------
;--- Alter or ADD common "Error" table messages ----------------------------
;----------------------------------------------------------------------------
#define? COMPANY_ERROR_1335 The required cabinet file '[2]' may be corrupt or we could not create a file during extraction. This could indicate a network error, an error reading from the CD-ROM, a problem with this package, or perhaps a problem extracting a file (destination path too long?).
#define? COMPANY_ERROR_1720 CUSTOM ACTION SCRIPT "[2]" COULDN'T START (OR TRAPPED DURING INITIALIZATION*). ERROR [3], [4]: [5] LINE [6], COLUMN [7], [8]
#define? COMPANY_ERROR_2740 CUSTOM ACTION SCRIPT "[2]" STARTED BUT FAILED. ERROR [3], [4]: [5] LINE [6], COLUMN [7], [8]
#define? COMPANY_ERROR_1721 CUSTOM ACTION "[2]" FAILED (could not start it). LOCATION: [3], COMMAND: [4]
#define? COMPANY_ERROR_1722 CUSTOM ACTION "[2]" FAILED (unexpected return code). LOCATION: [3], COMMAND: [4]
#define? COMPANY_ERROR_1909 Could not create Shortcut [2]. Verify that the destination folder exists and that you can access it. This can also happen if the "Target" of a shortcut doesn't exist (or not fully qualified) in the MSI.
#define? COMPANY_ERROR_2103 Could not resolve path for the shell folder "[2]". If the MSI is being executed under the SYSTEM account then remember that you must have ALLUSERS=1.
#define? COMPANY_ERROR_2705 Invalid table: "[2]" - Could not be linked as tree (this can occur if a directory tables "parent" directory is missing).
#(
#define? COMPANY_ERROR_2755
The server process failed processing the package "[3]" (RC = [2]).
A return code of 3 probably indicates a problem accessing the drive
or directory (substituted drives and network drives can be problematic).
A return code of 110 probably indicates an error opening the MSI file
(this can occur if the MSI is encrypted).
Try moving the MSI to C:\ (make sure its not compressed or encrypted).
#)
#(
#define @@ErrorMsg
#if ['<$COMPANY_ERROR_{$#1} $$ISBLANK>' = 'N']
;--- User didn't disable this message -------------------------------
<$Row Error="{$#1}" Message=^<$COMPANY_ERROR_{$#1}>^>
#endif
#)
<$Table "Error">
;--- Current message too misleading --------------------------------------
<$@@ErrorMsg "1335">
;--- Useful VBS Custom Action messages -----------------------------------
<$@@ErrorMsg "1720">
<$@@ErrorMsg "2740">
;--- Buggy/Missing/Misleading Messages (we have seen at install time) ---
<$@@ErrorMsg "2705"> ;;ICE03 error at validation time, but if not validating...
;--- Readable CA=EXE error messages --------------------------------------
<$@@ErrorMsg "1721">
<$@@ErrorMsg "1722">
;--- Useful when you try to install MSI in system account! ---------------
<$@@ErrorMsg "2103">
<$@@ErrorMsg "2755">
;--- Shortcut related ----------------------------------------------------
<$@@ErrorMsg "1909">
<$/Table>
;----------------------------------------------------------------------------
;--- Convert HTML to TEXT in a VB variable ----------------------------------
;----------------------------------------------------------------------------
#define? COMPANY_DISABLE_DESCRIPTION_Html2Text_CONVERSION N ;;You'd only change as a workaround to a serious problem... Let me know if you need to!
#( '<?NewLine>'
#define Html2Text
;--- Get the HTML in the form that can be placed between dowuble quotes ---
#RexxVar @@Html2Text = `{$HTML}`
#evaluate ^^ ^@@Html2Text = ReplaceString(@@Html2Text, '"', '""')^
;--- Only want to use each VB variable once... --------------------------
#ifdef @@VBVAR_{$VBVAR}
#error ^We have already used the VB variable "{$VBVAR}"!^
#end if
#define @@VBVAR_{$VBVAR}
;--- Generate the VB code -----------------------------------------------
<$Vbs "HTML TO TEXT Conversion">
#if ['<$COMPANY_DISABLE_DESCRIPTION_Html2Text_CONVERSION $$UPPER>' = 'Y']
;--- UNUSUAL - DISABLED - WHY? (LET ME KNOW) --------------------
dim {$VBVAR} : {$VBVAR} = "<??@@Html2Text>" 'No conversion done - Why not?
#elseif
;--- Do the HTML to TEXT conversion -----------------------------
dim {$VBVAR} : {$VBVAR} = Html2Text("<??@@Html2Text>")
err.clear() 'Ignore any error in called routine...
#endif
<$/Vbs>
#)
;----------------------------------------------------------------------------
;--- UISAMPLE.MSI contains an invalid "Billboard" table ---------------------
;----------------------------------------------------------------------------
<$Table "Billboard">
<$TableDelete>
<$/Table>
;----------------------------------------------------------------------------
;--- UISAMPLE.MSI contains an invalid "ListView" validation -----------------
;----------------------------------------------------------------------------
<$Table "_Validation">
#(
<$Row
@Where="`Table` = 'ListView' AND `Column` = 'Value'"
@OK='=1'
Category="Formatted" ;;Previous value = Identifier
>
#)
<$/Table>
;--- Always Need these tables -----------------------------------------------
<$TableCreate "FeatureComponents" DropExisting="N"> ;;Windows Installer will PV in MSI.DLL (in UI sequence) if missing
<$TableCreate "File" DropExisting="N"> ;;Windows Installer needs table (even if empty)
<$TableCreate "Media" DropExisting="N"> ;;Windows Installer needs table (even if empty)
;----------------------------------------------------------------------------
;--- Set up some MAKEMSI tables (move eventually?) --------------------------
;----------------------------------------------------------------------------
<$TableCreate "<$MAKEMSI_TABLENAME_FILESOURCE>">
;** [CommentBlockStart (23 August 2008 13:08:03, Dennis)
;**+----------------------------------------------------------------------
;**|<$Table "_Validation">
;**|#(
;**| <$Row
;**| Table="<$MAKEMSI_TABLENAME_FILESOURCE>"
;**| Column="File_"
;**| Nullable="N"
;**| KeyTable="File"
;**| KeyColumn="1"
;**| Category="Identifier"
;**| Description="Foreign key into the File table."
;**| >
;**|#)
;**|#(
;**| <$Row
;**| Table="<$MAKEMSI_TABLENAME_FILESOURCE>"
;**| Column="SourceFile"
;**| Nullable="N"
;**| Category="Text"
;**| Description="Full name of source file."
;**| >
;**|#)
;**|#(
;**| <$Row
;**| Table="<$MAKEMSI_TABLENAME_FILESOURCE>"
;**| Column="Date"
;**| Nullable="N"
;**| Category="Text"
;**| Description="Proposed date for the file."
;**| >
;**|#)
;**|#(
;**| <$Row
;**| Table="<$MAKEMSI_TABLENAME_FILESOURCE>"
;**| Column="Time"
;**| Nullable="N"
;**| Category="Text"
;**| Description="Proposed time for the file."
;**| >
;**|#)
;**|<$/Table>
;**+----------------------------------------------------------------------
;** CommentBlockEnd] (23 August 2008 13:08:03, Dennis)
#ifndef FILE_DISABLE_MD5_GENERATION_ALTOGETHER
<$TableCreate "MsiFileHash">
<$Table "_Validation">
#(
<$Row
Table="MsiFileHash"
Column="File_"
Nullable="N"
KeyTable="File"
KeyColumn="1"
Category="Identifier"
Description="Foreign key into the File table."
>
#)
#(
<$Row
Table="MsiFileHash"
Column="Options"
Nullable="N"
Category="Integer"
MinValue="0"
MaxValue="0"
Description="Reserved option (must be 0)."
>
#)
#(
#Define HashRow
<$Row
Table="MsiFileHash"
Column="HashPart{$#1}"
Nullable="N"
Category="DoubleInteger"
Description="MD5 part {$#1}/4."
>
#)
<$HashRow "1">
<$HashRow "2">
<$HashRow "3">
<$HashRow "4">
<$/Table>
#endif
;----------------------------------------------------------------------------
;--- Set up the "COMPLETE" feature ------------------------------------------
;----------------------------------------------------------------------------
#define? COMPANY_WANT_COMPLETE_FEATURE Y
#if ['<$COMPANY_WANT_COMPLETE_FEATURE>' = 'Y']
;--- User did not disable complete feature -------------------------------
;--[4Doco-COMPANY_WANT_COMPLETE_FEATURE]---
#define? COMPANY_COMPLETE_FEATURE_TITLE Complete
#define? COMPANY_COMPLETE_FEATURE_DESCRIPTION The Complete feature
#define? COMPANY_COMPLETE_FEATURE_DIRECTORY ;;Must be a "Directory" key (or blank)!
#define? COMPANY_COMPLETE_FEATURE_DISPLAY 1 ;;Expanded by default
#define? COMPANY_COMPLETE_FEATURE_DIRECTORY_AS_PRIMARY_FOLDER Y
#define? COMPANY_COMPLETE_FEATURE_INSTALL_ON_DEMAND N
#if ['<$COMPANY_COMPLETE_FEATURE_INSTALL_ON_DEMAND>' = 'N']
#define? COMPANY_COMPLETE_FEATURE_ATTRIBUTES UIDisallowAbsent
#elseif
#define? COMPANY_COMPLETE_FEATURE_ATTRIBUTES UIDisallowAbsent FavorSource FavorAdvertise
#endif
#ifndef COMPANY_COMPLETE_FEATURE ;;Name of complete feature
;--- Event log messages may show this but LITTLE other detail (make meaningful!) ---
#define? COMPANY_COMPLETE_FEATURE_TEMPLATE \
ALL.<$ProductVersion>.<$ProdInfo.ProductName> ;;Will truncate to max length (move valuable stuff to the left...)
#DefineRexx '' nopack
;--- Build ID that would identify product in Event log ----------
@@T = '<$COMPANY_COMPLETE_FEATURE_TEMPLATE>';
;--- Make sure it only contains valid chars for an ID -----------
<$Rexx2FixMsiId IDVAR="@@T">
;--- Make sure not longer than "Feature" table can handle -------
if length(@@T) > <$TABLES_LNG_FEATURE_COLUMN> then
@@T = left(@@T, <$TABLES_LNG_FEATURE_COLUMN>);
;--- Store it ---------------------------------------------------
Call MacroSet 'COMPANY_COMPLETE_FEATURE', @@T
#DefineRexx
#endif
;--[4Doco-COMPANY_WANT_COMPLETE_FEATURE]---
#(
<$Feature "<$COMPANY_COMPLETE_FEATURE>"
Directory_="<$COMPANY_COMPLETE_FEATURE_DIRECTORY>"
Title="<$COMPANY_COMPLETE_FEATURE_TITLE>"
Description="<$COMPANY_COMPLETE_FEATURE_DESCRIPTION>"
Attributes="<$COMPANY_COMPLETE_FEATURE_ATTRIBUTES>"
Display="<$COMPANY_COMPLETE_FEATURE_DISPLAY>"
>
#)
;--- Do we know the "complete" directory (yet)? --------------------------
#if ['<$COMPANY_COMPLETE_FEATURE_DIRECTORY>' <> '']
;--- We do but do we allow its use as install location? -------------
#if ['<$COMPANY_COMPLETE_FEATURE_DIRECTORY_AS_PRIMARY_FOLDER>' = 'Y']
<$PrimaryFolder Key="<$COMPANY_COMPLETE_FEATURE_DIRECTORY>">
#endif
#endif
#endif
;----------------------------------------------------------------------------
;--- Create standard directories --------------------------------------------
;----------------------------------------------------------------------------
#define? COMPANY_DEFINE_STANDARD_DIRECTORIES Y
#define? COMPANY_CREATE_STANDARD_DIRECTORIES_ON_DEMAND Y
#if ['<$COMPANY_DEFINE_STANDARD_DIRECTORIES>' = 'Y']
;--- Define a macro to create the definitions while allowing user to individually disable them ---
#(
;--- A "private" macro only used below ------------------------------
#define @@StdDir
;--- Set a default value and check if definition allowed ------------
#define? COMPANY_DEFINE_STANDARD_DIRECTORY_{$Key} Y
#if ['<$COMPANY_DEFINE_STANDARD_DIRECTORY_{$Key}>' = 'Y']
;--- We are allowed to create it --------------------------------
<$Directory Key="{$Key}" Parent="{$Parent}" Dir="{$Dir}" AsIs="Y" Conditional=^<$COMPANY_CREATE_STANDARD_DIRECTORIES_ON_DEMAND>^>
#endif
#)
;--- User wants or is allowing these definitions ------------------------
<$@@StdDir Key="TARGETDIR" Parent="" Dir="SourceDir">
<$@@StdDir Key="LocalAppDataFolder" Parent="TARGETDIR" Dir=".:APPLIC~1|Application Data">
<$@@StdDir Key="CommonAppDataFolder" Parent="TARGETDIR" Dir=".:APPLIC~1|Application Data">
<$@@StdDir Key="ProgramFilesFolder" Parent="TARGETDIR" Dir=".:ProgFile|Program Files">
<$@@StdDir Key="ProgramFiles64Folder" Parent="TARGETDIR" Dir=".:Prog64|Program Files 64">
<$@@StdDir Key="WindowsFolder" Parent="TARGETDIR" Dir=".:Windows">
<$@@StdDir Key="CommonFilesFolder" Parent="ProgramFilesFolder" Dir=".:Common">
<$@@StdDir Key="CommonFiles64Folder" Parent="ProgramFilesFolder" Dir=".:Comm64|Common Files 64">
<$@@StdDir Key="StartupFolder" Parent="ProgramMenuFolder" Dir=".:Startup">
<$@@StdDir Key="AdminToolsFolder" Parent="WindowsFolder" Dir=".:ADMINT~1|Admin Tools">
<$@@StdDir Key="TemplateFolder" Parent="WindowsFolder" Dir=".:ShellNew">
<$@@StdDir Key="System16Folder" Parent="WindowsFolder" Dir=".:System">
<$@@StdDir Key="SystemFolder" Parent="WindowsFolder" Dir=".:System32">
<$@@StdDir Key="System64Folder" Parent="WindowsFolder" Dir=".:System64">
<$@@StdDir Key="TempFolder" Parent="WindowsFolder" Dir=".:Temp">
;--- Profiles related folders -------------------------------------------
#define? COMPANY_DEFINE_PROFILE_RELATED_DIRECTORIES Y
#if ['<$COMPANY_DEFINE_PROFILE_RELATED_DIRECTORIES>' = 'Y']
<$@@StdDir Key="ProfilesFolder" Parent="WindowsFolder" Dir=".:Profiles">
<$@@StdDir Key="StartMenuFolder" Parent="ProfilesFolder" Dir=".:StartMen|Start Menu">
<$@@StdDir Key="ProgramMenuFolder" Parent="StartMenuFolder" Dir=".:Programs">
<$@@StdDir Key="AppDataFolder" Parent="ProfilesFolder" Dir=".:Applicat|Application Data">
<$@@StdDir Key="DesktopFolder" Parent="ProfilesFolder" Dir=".:Desktop">
<$@@StdDir Key="FavoritesFolder" Parent="ProfilesFolder" Dir=".:Favorite|Favorites">
<$@@StdDir Key="NetHoodFolder" Parent="ProfilesFolder" Dir=".:NetHood">
<$@@StdDir Key="PersonalFolder" Parent="ProfilesFolder" Dir=".:Personal">
<$@@StdDir Key="PrintHoodFolder" Parent="ProfilesFolder" Dir=".:PrintHoo|PrintHood">
<$@@StdDir Key="RecentFolder" Parent="ProfilesFolder" Dir=".:Recent">
<$@@StdDir Key="SendToFolder" Parent="ProfilesFolder" Dir=".:SendTo">
#endif
;--- Other folders ------------------------------------------------------
#define? COMPANY_DEFINE_OTHER_DIRECTORIES Y
#if ['<$COMPANY_DEFINE_OTHER_DIRECTORIES>' = 'Y']
<$@@StdDir Key="MyPicturesFolder" Parent="TARGETDIR" Dir=".:MYPICT~1|My Pictures">
<$@@StdDir Key="FontsFolder" Parent="WindowsFolder" Dir=".:Fonts">
#endif
#endif
;[SetUpgradeGuid]
;----------------------------------------------------------------------------
;--- Set MSI guids ----------------------------------------------------------
;----------------------------------------------------------------------------
#define? COMPANY_UPGRADE_CODE_QUALIFIER ;;Allow user scheme for having "sets" of upgrade codes
#if ['<$COMPANY_UPGRADE_CODE_QUALIFIER>' = '']
;--- Not part of a set (or at least using standard name) ----------------
#define @@UPGRADE_CODE_NAME UpgradeCode
#elseif
;--- Upgrade code name qualified by name of a "set" ---------------------
#option PUSH DefineMacroReplace=YES
#define @@UPGRADE_CODE_NAME UpgradeCode.<$COMPANY_UPGRADE_CODE_QUALIFIER>
#option POP
;--- Cludge so it can easily be referred to -----------------------------
#define VBSRET.GUID.UpgradeCode <$VBSRET.GUID.[@@UPGRADE_CODE_NAME]>
#endif
#define UpgradeCodeValue <$VBSRET.GUID.UpgradeCode> ;;Info returned from VBSCRIPT pass1
#define? COMPANY_UPGRADECODE_HOOK_AFTER_SETTING ;;Allow you to do something (perhaps validate value)
#( '<?NewLine>'
#define? COMPANY_SET_PROPERTY_UPGRADECODE
dim UpgradeCode ;;Need a VBSCRIPT variable
<$Guid '<$@@UPGRADE_CODE_NAME>' VB="UpgradeCode"> ;;Want same GUID every time!
<$Property "UpgradeCode" *Value="UpgradeCode"> ;;Use GUID "calculated" above
<$COMPANY_UPGRADECODE_HOOK_AFTER_SETTING> ;;Default is to do nothing (VBS variable "UpgradeCode" contains the value.
#)
#( '<?NewLine>'
#define? COMPANY_SET_PROPERTY_PRODUCTCODE
<$Property "ProductCode" *Value='GuidMake("ProductCode")'> ;;Random GUID
#)
#( '<?NewLine>'
#define? COMPANY_SET_PROPERTY_PACKAGECODE
<$Summary "PackageCode" *Value='GuidMake("PackageCode")'> ;;Random GUID
#)
<$COMPANY_SET_PROPERTY_UPGRADECODE> ;;User can override above macros to change behaviour...
<$COMPANY_SET_PROPERTY_PRODUCTCODE>
<$COMPANY_SET_PROPERTY_PACKAGECODE>
;[SetUpgradeGuid]
;----------------------------------------------------------------------------
;--- By default make PER MACHINE --------------------------------------------
;----------------------------------------------------------------------------
#define? COMPANY_ALLUSERS_CREATE_PROPERTY Y ;;Y/N
#if ['<$COMPANY_ALLUSERS_CREATE_PROPERTY>' <> 'N']
#define? COMPANY_ALLUSERS_PROPERTY 1 ;;1=Per Machine
<$Property "ALLUSERS" Value="<$COMPANY_ALLUSERS_PROPERTY>">
#endif
;[4Doco-COMPANY_REINSTALLMODE]
;----------------------------------------------------------------------------
;--- Default to overwriting (file from package ALWAYS correct) --------------
;----------------------------------------------------------------------------
#define? COMPANY_REINSTALLMODE amus ;;Normal MSI default is "omus"
#if ['<$COMPANY_REINSTALLMODE>' <> '']
;--- User wants or allows this change (value wasn't blanked) -------------
<$Property "REINSTALLMODE" Value=^<$COMPANY_REINSTALLMODE>^>
#endif
;[4Doco-COMPANY_REINSTALLMODE]
;----------------------------------------------------------------------------
;--- Set Product name (allow overriding of default) -------------------------
;----------------------------------------------------------------------------
#define? COMPANY_PRODUCT_NAME_PREFIX.P ;;None for production
#define? COMPANY_PRODUCT_NAME_PREFIX.D ;;!!! etc = Developer friendy - sorts up front in ARP
#define? COMPANY_PRODUCT_NAME_PREFIX <$COMPANY_PRODUCT_NAME_PREFIX.[MMMODE]>
#define? COMPANY_PROPERTY_PRODUCTNAME <$COMPANY_PRODUCT_NAME_PREFIX><$ProdInfo.ProductName>
<$Property "ProductName" Value="<$COMPANY_PROPERTY_PRODUCTNAME>">
;----------------------------------------------------------------------------
;--- Basic MSI summary items ------------------------------------------------
;----------------------------------------------------------------------------
#define? COMPANY_SUMMARY_TEMPLATE Intel;1033
#define? COMPANY_SUMMARY_SCHEMA 110 ;;Minimum of Windows Installer v1.1 is required for this msi (a type of launch condition)
#define? COMPANY_SUMMARY_TITLE <$COMPANY_PRODUCT_NAME_PREFIX><$ProdInfo.ProductName>
#define? COMPANY_SUMMARY_SUBJECT <$ProductVersion> (created <?CompileTime>)
#define? COMPANY_PACKAGE_REQUIRES_ELEVATED_PRIVLEDGES Y
#if ['<$COMPANY_PACKAGE_REQUIRES_ELEVATED_PRIVLEDGES $$UPPER>' <> 'N']
;--- Elevated privledges are (or may be) required -----------------------
#define? COMPANY_SUMMARY_SourceType msidbSumInfoSourceTypeCompressed
#elseif
;--- Elevated privledges are not required -------------------------------
#define? COMPANY_SUMMARY_SourceType msidbSumInfoSourceTypeCompressed or msidbSumInfoSourceTypeLUAPackage
#endif
<$Summary "TEMPLATE" Value="<$COMPANY_SUMMARY_TEMPLATE>">
<$Summary "MsiSchema" Value="<$COMPANY_SUMMARY_SCHEMA>">
<$Summary "TITLE" VALUE="<$COMPANY_SUMMARY_TITLE>">
<$Summary "Subject" VALUE="<$COMPANY_SUMMARY_SUBJECT>">
<$Summary "SourceType" Value="<$COMPANY_SUMMARY_SourceType>">
<$Summary "CREATE_DTM" VALUE="now()">
<$Summary "EDITTIME" VALUE="now()">
<$Summary "LASTSAVE_DTM" *VALUE="Empty"> ;;Don't want
<$Summary "LASTPRINTED" *VALUE=^Empty^> ;;Don't want
#define? COMPANY_SET_SUMMARY_COMMENTS Y
#if ['<$COMPANY_SET_SUMMARY_COMMENTS $$UPPER>' = 'Y']
#define? COMPANY_SUMMARY_COMMENTS <$ProdInfo.Description>
<$Html2Text VBVAR="VB_COMMENTS" HTML=^<$COMPANY_SUMMARY_COMMENTS>^>
<$Summary "COMMENTS" *VALUE="VB_COMMENTS">
#endif
;----------------------------------------------------------------------------
;--- Set AUTHOR related (allow overriding of default) -----------------------
;----------------------------------------------------------------------------
#define? COMPANY_PROPERTY_MANUFACTURER <$DEPT_MSI_MANUFACTURER>
#define? COMPANY_SUMMARY_AUTHOR <$DEPT_MSI_AUTHOR> - using MAKEMSI
#define? COMPANY_SUMMARY_LASTAUTHOR <$DEPT_MSI_AUTHOR>
<$Property "Manufacturer" Value="<$COMPANY_PROPERTY_MANUFACTURER>">
<$Summary "AUTHOR" VALUE="<$COMPANY_SUMMARY_AUTHOR>">
<$Summary "LastAuthor" VALUE="<$COMPANY_SUMMARY_LASTAUTHOR>">
;----------------------------------------------------------------------------
;--- Set CONTACT details (allow overriding of default) ----------------------
;----------------------------------------------------------------------------
#define? COMPANY_CONTACT_NAME
#define? COMPANY_CONTACT_NAME_PHONE
#if ['<$COMPANY_CONTACT_NAME>' <> '']
<$Property "ARPCONTACT" VALUE=^<$COMPANY_CONTACT_NAME>^>
#if ['<$COMPANY_CONTACT_NAME_PHONE>' <> '']
<$Property "ARPHELPTELEPHONE" VALUE=^<$COMPANY_CONTACT_NAME_PHONE>^>
#endif
#endif
;----------------------------------------------------------------------------
;--- Web Links in Add/Remove programs ---------------------------------------
;----------------------------------------------------------------------------
#define? COMPANY_ARP_URL_PUBLISHER <$DEPT_ARP_URL_PUBLISHER>
#define? COMPANY_ARP_URL_TECHNICAL_SUPPORT <$DEPT_ARP_URL_TECHNICAL_SUPPORT>
#define? COMPANY_ARP_URL_APPLICATION_UPDATE_INFORMATION <$DEPT_ARP_URL_APPLICATION_UPDATE_INFORMATION>
#if ['<$COMPANY_ARP_URL_PUBLISHER>' <> '']
;--- "Publisher" becomes hypertext link in WINXP ARP --------------------
<$Property "ARPURLINFOABOUT" Value="<$COMPANY_ARP_URL_PUBLISHER>">
#endif
#if ['<$COMPANY_ARP_URL_TECHNICAL_SUPPORT>' <> '']
;--- "Support Information" in WINXP ARP ---------------------------------
<$Property "ARPHELPLINK" Value="<$COMPANY_ARP_URL_TECHNICAL_SUPPORT>">
#endif
#if ['<$COMPANY_ARP_URL_APPLICATION_UPDATE_INFORMATION>' <> '']
;--- "Product Updates:" in WINXP ARP ------------------------------------
<$Property "ARPURLUPDATEINFO" Value="<$COMPANY_ARP_URL_APPLICATION_UPDATE_INFORMATION>">
#endif
;----------------------------------------------------------------------------
;--- Set properties ---------------------------------------------------------
;----------------------------------------------------------------------------
<$Property "ProductVersion" Value="<$ProductVersion>">
#define? COMPANY_SET_ARPCOMMENTS Y
#if ['<$COMPANY_SET_ARPCOMMENTS $$UPPER>' = 'Y']
#define? COMPANY_PROPERTY_ARPCOMMENTS <$COMPANY_SUMMARY_COMMENTS>
<$Html2Text VBVAR="VB_ARPCOMMENTS" HTML=^<$COMPANY_PROPERTY_ARPCOMMENTS>^>
;--- WinXP doesn't do good job of wrapping comments... ------------------
#define? COMPANY_ARPCOMMENTS_WRAP_AT_DOT Y
#if ['<$COMPANY_ARPCOMMENTS_WRAP_AT_DOT $$UPPER>' = 'Y']
;--- Assume dot is end of sentance, therefore good place to wrap ----
VB_ARPCOMMENTS = replace(VB_ARPCOMMENTS, ". ", "." & vbCRLF) ;;Avoid dots in version numbers etc!
VB_ARPCOMMENTS = replace(VB_ARPCOMMENTS, vbCRLF & vbCRLF & vbCRLF, vbCRLF & vbCRLF) ;;If aleady had "para", above line made too big...
#endif
;--- Set the property ---------------------------------------------------
<$Property "ARPCOMMENTS" *VALUE="VB_ARPCOMMENTS">
#endif
;----------------------------------------------------------------------------
;--- Upgrade (REPLACE) and MSI we have upgrade codes for! -------------------
;----------------------------------------------------------------------------
;[UseUpgradeCode]
#define? COMPANY_AUTO_UNINSTALL_VIA_UPGRADE_TABLE Y
#if ['<$COMPANY_AUTO_UNINSTALL_VIA_UPGRADE_TABLE>' = 'Y']
;--- Look for older/newer versions of the same package (group) -----------
#define UpgradeCode_PROPERTY UNINSTALLTHIS ;;Use this property in "Upgrade" table entry
<$UpgradeTable "=UpgradeCode"> ;;Use value in VB variable
;--- Any EXTRA upgrade codes to be handled? ------------------------------
#if ['<$ProdInfo.UpgradeCodes>' <> '']
<$UpgradeTable "<$ProdInfo.UpgradeCodes>">
#endif
;--- Install MSI AFTER complete uninstallation of older ------------------
#define? COMPANY_RemoveExistingProducts_HOOK_BEFORE_MOVING
#define? COMPANY_RemoveExistingProducts_HOOK_AFTER_MOVING
#define? COMPANY_RemoveExistingProducts_SEQ InstallValidate-InstallInitialize
#(
;--- Allow easy overiding/removal of this step ----------------------
#define? COMPANY_MOVE_RemoveExistingProducts
<$Table "InstallExecuteSequence">
;--- Move to desired location -----------------------------------
dim RepSeq : RepSeq = GetSeqNumber("InstallExecuteSequence", "<$COMPANY_RemoveExistingProducts_SEQ>", 1)
<$Row Action="RemoveExistingProducts" *Sequence="RepSeq">
<$/Table>
#)
<$COMPANY_RemoveExistingProducts_HOOK_BEFORE_MOVING>
<$COMPANY_MOVE_RemoveExistingProducts>
<$COMPANY_RemoveExistingProducts_HOOK_AFTER_MOVING>
#endif
;[UseUpgradeCode]
;----------------------------------------------------------------------------
;--- Set up end of package --------------------------------------------------
;----------------------------------------------------------------------------
#define? COMPANY_ONEXIT_HOOK_BEFORE_ZIPPING
#define? COMPANY_ONEXIT_HOOK_AFTER_ZIPPING
#define? COMPANY_ONEXIT_HOOK_STILL_IN_COMPLETE_FEATURE
#define? COMPANY_VBSCRIPT_FUNCTIONS
#define? COMPANY_VALIDATE_NESTING Y
#if ['<$COMPANY_VALIDATE_NESTING>' = 'N']
;--- Turned off (Don't turn off unless theer is a reason AND if there is let me know!) ---
#define? @@COMPANY_VALIDATE_NESTING ;;No nothing
#elseif
;--- User want or is allowing the validation (hopefully won't cause problems) ---
#define? @@COMPANY_VALIDATE_NESTING \
#evaluate ^^ ^call ValidateNesting^
#endif
#( ''
#define COMPANY_ONEXIT
;--- Zip source code if wanted -------------------------------------------
<$COMPANY_ONEXIT_HOOK_BEFORE_ZIPPING>
<$CommonFramework-ZipSourceCode>
<$COMPANY_ONEXIT_HOOK_AFTER_ZIPPING>
;--- A HOOK --------------------------------------------------------------
<$COMPANY_ONEXIT_HOOK_STILL_IN_COMPLETE_FEATURE>
;----------------------------------------------------------------------------
;--- Include "UISAMPLE" related changes -------------------------------------
;----------------------------------------------------------------------------
#NextId PUSH
#include "UiSample.MMH"
#NextId POP
;--- Add generated DOCO to the MSI ---------------------------------------
<$@@COMPANY_ADD_GENERATED_DOCO>
;--- Now finished with the "COMPLETE" feature ----------------------------
#if ['<$COMPANY_WANT_COMPLETE_FEATURE>' = 'Y']
;--- User did not disable complete feature ---------------------------
<$/Feature>
#endif
;--- End the package -----------------------------------------------------
<$/Msi>
;--- Include any user defined VBSCRIPT functions -------------------------
<$COMPANY_VBSCRIPT_FUNCTIONS>
;--- PPWIZARD "05.203" onwards can validate nesting at any time ----------
<$@@COMPANY_VALIDATE_NESTING>
#)
#OnExit #69 <$COMPANY_ONEXIT>
;----------------------------------------------------------------------------
;--- We wish to add the generated documentation to the MSI ------------------
;----------------------------------------------------------------------------
;---[4Doco-COMPANY_ADD_GENERATED_DOCO]---
#if ['<$ONEXIT_GENERATE_HTML>' = 'N']
;--- We didn't create any documentation (so nothing to add!) ------------
#define? @@COMPANY_ADD_GENERATED_DOCO
#define+ MSI_COMPLETE_AT_END_OF_PASS 1 ;;No need for 2nd pass if not adding the doco!
#elseif
;--- We did generate the documentation ----------------------------------
#define? COMPANY_WANT_TO_INSTALL_DOCUMENTATION Y
#if ['<$COMPANY_WANT_TO_INSTALL_DOCUMENTATION>' = 'N']
;--- We have been told not to add the documenation to the MSI -------
#define+ MSI_COMPLETE_AT_END_OF_PASS 1 ;;No need for 2nd pass if not adding the doco!
#define? @@COMPANY_ADD_GENERATED_DOCO
#elseif
;--- User wants us the add the documentation to the MSI -------------
#define? COMPANY_DOCO_BASE_DIR c:\Program Files\
#define? COMPANY_DOCO_ADD2_BASE_DIR MAKEMSI Package Documentation\
#define? COMPANY_DOCO_RELATIVE_DIR <$COMPANY_NAME>\<$DEPT_NAME>
#define? COMPANY_HTMLRPT_DOCO_INSTALL_DIR <$COMPANY_DOCO_BASE_DIR><$COMPANY_DOCO_ADD2_BASE_DIR><$COMPANY_DOCO_RELATIVE_DIR>
#define? COMPANY_HTMLRPT_DOCO_COMPONENTS_GUID * ;;Ramdom one is fine...
#ifndef COMPANY_HTMLRPT_DOCO_INSTALL_DIR_KEY
;--- User didn't tell us what key to use -------------------
#define COMPANY_HTMLRPT_DOCO_INSTALL_DIR_KEY MAKEMSI_DOCO
#define @@CreateDocoKey
#endif
#define? COMPANY_HTMLRPT_NAME_LONG <$MSI_HTMLNAME $$FilePart:NAME> ;;Alternative = "<$ProdInfo.ProductName>(<$ProductVersion>).hta"
#define? COMPANY_HTMLRPT_NAME_8.3 MSIRPT.HTA
#ifndef COMPANY_COMPLETE_FEATURE
;--- Don't have a complete feature ------------------------------
#define? COMPANY_HTMLRPT_FEATURE ;;User will have to tell us!
#elseif
;--- We know where we can add it! -------------------------------
#define? COMPANY_HTMLRPT_FEATURE <$COMPANY_COMPLETE_FEATURE>
#endif
#if ['<$COMPANY_HTMLRPT_FEATURE>' = '']
#error ^To add the HTML to the MSI we need to know the name of a feature, as{NL}you have turned off the "complete" feature you must supply this name in{NL}the "COMPANY_HTMLRPT_FEATURE" macro!^
#endif
#(
#define? @@COMPANY_ADD_GENERATED_DOCO
<$HookInto "MAKEMSI_HOOK_SECOND_PASS_PROCESSING" After="@@AddDocumentationToTheMsi">
#)
#(
#define @@AddDocumentationToTheMsi
;--- Add later in case directory not yet known -------------------
#ifdef @@CreateDocoKey
<$DirectoryTree Key="<$COMPANY_HTMLRPT_DOCO_INSTALL_DIR_KEY>" Dir="<$COMPANY_HTMLRPT_DOCO_INSTALL_DIR>">
#endif
#define? FILE_HTMLRPT_INSTALLED_PER_MACHINE Y