The optional Instructions XML file you create provides Package Manager with instructions for customized execution of package installation.
Name the instructions XML file instructions, omit the file extension, and place it in the root of the data directory of a File package.
The following text is an example instructions file for a File package.
<instructions> <targetAttributes readOnly="allReadOnly"/> <shortcuts> <shortcut> <destination root="ProgramMenu" path="Test\Shortcut.lnk"> <localizedDestination root="ProgramMenu" path="Test\Verknüpfung.lnk" language="de"/> <localizedDestination root="ProgramMenu" path="Test\Raccourci.lnk" language="fr"/> <localizedDestination root="ProgramMenu" path="Test\ショートカット.lnk" language="ja"/> <localizedDestination root="ProgramMenu" path="Test\바로가기.lnk" language="ko"/> <localizedDestination root="ProgramMenu" path="Test\快捷方式.lnk" language="zh-CN"/> </destination> <target root="Program Files" path="Shortcuts\executable.exe"/> </shortcut> </shortcuts> <customExecutes> <customExecute root="Documents" exeName="executable.exe"/> </customExecutes> </instructions>
The <targetAttributes> element provides optional instructions regarding locations where Package Manager installs files on the target system.
<targetAttributes> is an empty element, meaning that it has attributes, but does not contain elements or text content. It has the following attributes:
The <shortcuts> element provides a list of shortcuts that Package Manager creates during installation.
<shortcuts> contains the <shortcut> child element.
The <shortcut> element defines one shortcut that Package Manager creates during installation.
The <destination> element specifies the location where Package Manger creates a shortcut file.
<destination> is required and can have one or more optional <localizedDestination> child elements. It has the following attributes:
Attribute Name | Type | Value | Examples |
---|---|---|---|
root | String | A supported target root. Packages with a windows_all or windows_x86 architecture cannot use 64-bit specific target roots, such as ProgramFiles_64 or LV2017DIR64. | <destination root="Startup" path="testShortcut.lnk"/> |
path | String | The path and file name appended to the root target. | <destination root="ProgramFiles" path="Shortcuts\test.exe"/> |
The <localizedDestination> element specifies an alternate localized path to use for the shortcut file when installing the file package in a given language.
<localizedDestination> is an empty element, meaning that is has attributes, but does not contain elements or text content. It has the following attributes:
Attribute Name | Type | Value | Examples |
---|---|---|---|
root | String | A supported target root. Packages with a windows_all or windows_x86 architecture cannot use 64-bit specific target roots, such as ProgramFiles_64 or LV2017DIR64. | <localizedDestination root="ProgramMenu"/> |
path | String | The path and file name appended to the root target. | <localizedDestination root="ProgramMenu" path="Test\Verknüpfung.lnk" /> |
language | String | Language code of the localized path. Possible values:
|
<localizedDestination root="ProgramMenu" path="Test\Verknüpfung.lnk" language="de"/> |
The <target> element specifies the location of the file for which Package Manager creates a shortcut.
<target> is an empty element, meaning that it has attributes, but does not contain elements or text content. It has the following attributes:
Attribute Name | Type | Value | Examples |
---|---|---|---|
root | String | A supported target root. Packages with a windows_all or windows_x86 architecture cannot use 64-bit specific target roots, such as ProgramFiles_64 or LV2017DIR64. | <target root="Startup" path="testShortcut.lnk"/> |
path | String | The path and file name appended to the root target after it is resolved. | <target root="ProgramFiles" path="Shortcuts\test.exe"/> |
The <customExecutes> element provides a list of custom actions for Package Manager to perform on the package.
<customExecutes> contains the <customExecute> child element.
The <customExecute> element defines one custom action Package Manager performs on the package.
The <customExecute> element is optional in the Instructions file, but you can include as many as needed for your package.<customExecute> is an empty element, meaning that it has attributes, but does not contain elements or text content. It has the following attributes:
Attribute Name | Type | Required | Value | Description | Details | Examples |
---|---|---|---|---|---|---|
root | String | Yes | The root path to the executable. Packages with a windows_all or windows_x86 architecture cannot use 64-bit specific target roots, such as ProgramFiles_64 or LV2017DIR64. | Specifies the root path to the executable. |
![]()
Note
To run an executable, you must first install the package that includes the executable. You can configure a package to temporarily install the executable by setting the target root path to NIPkgMgrTempUnique and setting the schedule attribute to post. Package Manager then installs the package to the NIPkgMgrTempUnique directory and runs the executable from there before deleting files in the directory. |
<customExecute root="Documents" exeName="executable.exe"/> |
exeName | String | Yes | The file name of the executable. | Specifies the file name of the executable. | Can include a path relative to the root. | <customExecute root="ProgramData" exeName="actions\executable.exe"/> |
arguments | String | No | Command line arguments to pass to the executable. | Specifies command line arguments for Package Manager to pass to the executable. | The value is formatted. You can include a supported target root and/or the following arguments:
|
|
step | Enum | No |
|
Specifies the transaction step during which Package Manager runs the executable. | <customExecute step="uninstall" root="ProgramData" ignoreErros="y" exeName="actions\executable.exe"/> | |
schedule | Enum | No | Specifies the relative point within the transaction steps when Package Manager runs the executable. | If you omit this attribute, Package Manager uses its default value. | <customExecute step="install" schedule="post" root="ProgramData" exeName="executable.exe"/> | |
wait | Boolean | No | Specifies whether the custom action is synchronous, where Package Manager should wait for it to finish before continuing, or asynchronous, where Package Manager should not wait. | If you omit this attribute, Package Manager uses its default value. | <customExecute root="ProgramData" exeName="executable.exe" wait="n"/> | |
ignoreErrors | Boolean | No | Specifies whether Package Manager reports an error if it cannot run the executable or the executable returns a value other than 0. | <customExecute root="ProgramData" exeName="executable.exe" wait="y" ignoreErrors="y"/> | ||
hideConsoleWindow | Boolean | No | Specifies whether to hide the console window for console applications. | <customExecute root="ProgramData" exeName="executable.exe" hideConsoleWindow="y"/> |
For Instructions files in which you include a <customExecute> element where schedule="postall", Package Manager demonstrates specific behaviors that may affect package installation.
The postall value instructs Package Manager to run the executable after completing the installation, reinstallation, and/or removal steps for all packages.