Pack format - get-ntmu/NTMU GitHub Wiki
This page will document the format of the pack.ini file used for pack definitions.
Every pack must have this section. This section defines basic metadata about the pack.
- The properties
Name,Author, andVersionare all simple strings that are displayed to the user at the top of the program. - The
Previewproperty is a relative path to an image file that will be displayed in the top right pane. - The
Readmeproperty is a relative path to a plain text file whose contents will be displayed to the user in the left pane. - The
MinBuildandMaxBuildproperties are non-negative integers that denote the minimum and maximum build of Windows the pack can be applied to, respectively. If the Windows build of the end user does not match this build, the pack will fail to load.
None of these options are technically required to load the pack, but it is good practice to include every one of these except for MinBuild and MaxBuild, unless necessary. Packs without the aforementioned properties in their Pack section will be rejected from the official pack repository.
[Pack]
Name = NTMU Test Pack
Author = aubymori
Version = 1.0.0
Preview = preview.png
Readme = README
MinBuild = 10240
MaxBuild = 19045Packs can have author-defined options that the user can change in the UI before applying the pack. The section name format is: Options.TheOptionID. Here are the properties for option sections:
-
Nameis a string property that defines the name for the option that is shown to the user. If it is not set, the option ID will be used instead. -
DefaultValuedefines the default value for the option. If it is not valid for that option, the parser will throw an error. If this value is not set, the default value will be 0. - Any property with the name being a non-negative integer will define a radio option for that option. The value will be the display name of said radio option. If there are none of these, the option will be treated as a checkbox, and the only valid values will be 0 and 1.
[Options.CheckboxOpt]
Name = Checkbox option
DefaultValue = 1
[Options.RadioOpt]
Name = Radio option
DefaultValue = 2
0 = Option 0
1 = Option 1
2 = Option 2The modifications are split into "sections", which each define source and destination files, as well as some requirements for the section to be processed. Here are the generic section properties:
-
Requiresdefines the required options for this section to be processed, with the format:CheckboxOpt=1,RadioOpt=2. -
MinBuildandMaxBuilddefine the minimum and maximum Windows build for this section to be processed, respectively.
[Registry]
Requires = CheckboxOpt=1,RadioOpt=2
MinBuild = 10240
MaxBuild = 19045This section defines registry files (.reg) to be imported into the system registry. Here are the properties:
-
TrustedInstalleris a boolean value (either 0 or 1) that defines whether or not the registry files in this section should be imported as TrustedInstaller. When this is enabled, keys imported toHKEY_CURRENT_USERwill be imported to the key for the SYSTEM user (HKEY_USERS\.Default). This is 0 by default. - Any property name that does not match the pre-defined ones (
Requires,TrustedInstaller, etc.) will have its value treated as a relative file path to a.regfile to be imported.
[Registry]
TrustedInstaller = 1
0 = registry\keys.reg
LiterallyAnything = registry\otherkeys.regThis section defines files to be copied from the pack folder to a location on the system. Here are the properties:
- Any property name that does not match the pre-defined ones (
Requires,MinBuild, etc.) will have its name treated as an absolute file path to the destination of the copied file. Their value will be treated as a relative file path to the file to be copied. - The destination file path supports the use of environment variables.
[Files]
%SystemRoot%\System32\notepad.exe = files\notepad.exe
C:\some\nonexistent\dir\file.ext = files\file.ext- File copying is done as TrustedInstaller.
- If the target directory for a file does not exist, it will be created.
- If the target file exists, it will be renamed before copying.
- The renamed file will match the format:
filename.old.index, where index is the lowest index available, starting from zero. - For example:
imageres.dll,imageres.dll.old.0,imageres.dll.old.1, etc.
- The renamed file will match the format:
This section defines resource files to be imported into existing system files. Here are the properties:
- Any property name that does not match the pre-defined ones (
Requires,MinBuild, etc.) will have its name treated as an absolute file path to the destination of the new resources. Their value will be treated as a relative file path to the file to be grab resources from. - The source file can either be a compiled resource file (
.res) or a Portable Executable (.exe,.dll, etc.). -
<Locale>in the destination file path will be replaced with the user's locale name (e.g.en-US). This is mainly useful for applying icon resources to the MUI file for signed files (e.g. shell32.dll, explorer.exe) where a MUN does not exist. - If the destination path starts with
<System>\, it will be treated as a path to a file in System32, and NTMU will apply resources to the following files:- If it exists,
%SystemRoot%\SystemResources\<file>.mun. - If the MUN doesn't exist,
%SystemRoot%\System32\<file>and/or%SystemRoot%\SysWOW64\<file>if they exist.
- If it exists,
[Resources]
<System>\imageres.dll = resources\imageres.res
<System>\<Locale>\shell32.dll.mui = resources\shell32.resThe file copying rules from the Files section also apply to this section, minus the creation of non-existing directories, since non-existent files will cause a failure.
Strings are not individual resources, rather they are stored in groups of 16 in stringtable resources. If you want to replace a single string, you will have to replace the whole table it's contained in, making sure to keep the other items.