use std::collections::HashMap;
use std::sync::LazyLock;
pub static GLOBAL_PARAMETERS: LazyLock<HashMap<&'static str, &'static str>> = LazyLock::new(|| {
HashMap::from([
("/silent", "/SILENT"),
("/filesonly", "/FILESONLY"),
("/rebootok", "/REBOOTOK"),
("/short", "/SHORT"),
("/sd", "/SD"),
("/branding", "/BRANDING"),
("/final", "/FINAL"),
("/solid", "/SOLID"),
("/global", "/GLOBAL"),
("/bom", "/BOM"),
("/italic", "/ITALIC"),
("/underline", "/UNDERLINE"),
("/strike", "/STRIKE"),
("/enablecancel", "/ENABLECANCEL"),
("/overwrite", "/OVERWRITE"),
("/replace", "/REPLACE"),
("/noerrors", "/NOERRORS"),
("/regedit5", "/REGEDIT5"),
("/exeresource", "/EXERESOURCE"),
("/stringid", "/STRINGID"),
("/resizetofit", "/RESIZETOFIT"),
("/resizetofitwidth", "/RESIZETOFITWIDTH"),
("/resizetofitheight", "/RESIZETOFITHEIGHT"),
("/trimleft", "/TRIMLEFT"),
("/trimright", "/TRIMRIGHT"),
("/trimcenter", "/TRIMCENTER"),
("/windows", "/windows"),
("/nonfatal", "/NONFATAL"),
("/nocustom", "/NOCUSTOM"),
("/uninstnocustom", "/UNINSTNOCUSTOM"),
("/componentsonlyoncustom", "/COMPONENTSONLYONCUSTOM"),
(
"/uninstcomponentsonlyoncustom",
"/UNINSTCOMPONENTSONLYONCUSTOM",
),
("/fileexists", "/FILEEXISTS"),
("/rawnl", "/RAWNL"),
("/productversion", "/ProductVersion"),
("/noworkingdir", "/NoWorkingDir"),
("/r", "/r"),
("/a", "/a"),
("/e", "/e"),
("/o", "/o"),
("/x", "/x"),
("/ifempty", "/ifempty"),
("/ifnosubkeys", "/ifnosubkeys"),
("/ifnovalues", "/ifnovalues"),
("/nounload", "/nounload"),
("/plugin", "/plugin"),
("/ifndef", "/ifndef"),
("/redef", "/redef"),
("/date", "/date"),
("/utcdate", "/utcdate"),
("/file", "/file"),
("/intfmt", "/intfmt"),
("/math", "/math"),
("/ignorecase", "/ignorecase"),
("/packed", "/packed"),
("/target", "/target"),
])
});
pub static GLOBAL_PARAMETER_PREFIXES: LazyLock<HashMap<&'static str, &'static str>> =
LazyLock::new(|| {
HashMap::from([
("/lang=", "/LANG="),
("/timeout=", "/TIMEOUT="),
("/charset=", "/CHARSET="),
("/imgid=", "/IMGID="),
("/customstring=", "/CUSTOMSTRING="),
("/uninstcustomstring=", "/UNINSTCUSTOMSTRING="),
("/oname=", "/oname="),
])
});
pub static INSTRUCTION_PARAMETERS: LazyLock<
HashMap<&'static str, HashMap<&'static str, &'static str>>,
> = LazyLock::new(|| {
let mut builder: HashMap<&str, HashMap<&str, &str>> = HashMap::new();
let mut register = |instructions: &[&'static str], params: &[(&'static str, &'static str)]| {
for &instr in instructions {
let map = builder.entry(instr).or_default();
for &(k, v) in params {
map.insert(k, v);
}
}
};
register(
&[
"allowrootdirinstall",
"allowskipfiles",
"autoclosewindow",
"crccheck",
"manifestdpiaware",
"manifestdisablewindowfiltering",
"manifestgdiscaling",
"manifestlongpathaware",
"setautoclose",
"setdatablockoptimize",
"setdatesave",
"setpluginunload",
"unicode",
"windowicon",
],
&[("true", "true"), ("false", "false")],
);
register(
&[
"crccheck",
"logset",
"lockwindow",
"setcompress",
"setdatesave",
"setdatablockoptimize",
"setoverwrite",
"windowicon",
"xpstyle",
"licenseforceselection",
],
&[("on", "on"), ("off", "off")],
);
register(&["fileopen"], &[("r", "r"), ("w", "w"), ("a", "a")]);
register(
&["setcompressor"],
&[("zlib", "zlib"), ("bzip2", "bzip2"), ("lzma", "lzma")],
);
register(&["target"], &[("x86", "x86"), ("amd64", "amd64")]);
register(
&["setoverwrite"],
&[
("try", "try"),
("ifnewer", "ifnewer"),
("ifdiff", "ifdiff"),
("lastused", "lastused"),
],
);
register(&["setcompress"], &[("auto", "auto"), ("force", "force")]);
register(
&["silentinstall"],
&[
("normal", "normal"),
("silent", "silent"),
("silentlog", "silentlog"),
],
);
register(
&["silentuninstall", "setsilent"],
&[("normal", "normal"), ("silent", "silent")],
);
register(
&["showinstdetails", "showuninstdetails"],
&[
("hide", "hide"),
("show", "show"),
("nevershow", "nevershow"),
],
);
register(
&["setdetailsview", "dirshow"],
&[("show", "show"), ("hide", "hide")],
);
register(
&["setdetailsprint"],
&[
("listonly", "listonly"),
("textonly", "textonly"),
("both", "both"),
("none", "none"),
("lastused", "lastused"),
],
);
register(
&["requestexecutionlevel"],
&[
("none", "none"),
("user", "user"),
("highest", "highest"),
("admin", "admin"),
],
);
register(
&["addbrandingimage"],
&[
("top", "top"),
("left", "left"),
("bottom", "bottom"),
("right", "right"),
],
);
register(
&["instprogressflags"],
&[("smooth", "smooth"), ("colored", "colored")],
);
register(
&["licenseforceselection"],
&[("checkbox", "checkbox"), ("radiobuttons", "radiobuttons")],
);
register(
&["setshellvarcontext"],
&[("all", "all"), ("current", "current")],
);
register(&["dirverify"], &[("auto", "auto"), ("leave", "leave")]);
register(
&["execshell", "execshellwait"],
&[("open", "open"), ("print", "print")],
);
register(
&["page", "uninstpage"],
&[
("custom", "custom"),
("license", "license"),
("components", "components"),
("directory", "directory"),
("instfiles", "instfiles"),
("uninstconfirm", "uninstConfirm"),
],
);
register(&["setctlcolors"], &[("transparent", "transparent")]);
register(&["lockwindow"], &[("on", "on"), ("off", "off")]);
register(&["setregview"], &[("default", "default")]);
register(
&[
"deleteregkey",
"deleteregvalue",
"enumregkey",
"enumregvalue",
"installdirregkey",
"readregdword",
"readregstr",
"writeregbin",
"writeregdword",
"writeregexpandstr",
"writeregmultistr",
"writeregnone",
"writeregstr",
],
&[
("hkcr", "HKCR"),
("hkcr32", "HKCR32"),
("hkcr64", "HKCR64"),
("hklm", "HKLM"),
("hklm32", "HKLM32"),
("hklm64", "HKLM64"),
("hkcu", "HKCU"),
("hkcu32", "HKCU32"),
("hkcu64", "HKCU64"),
("hku", "HKU"),
("hkcc", "HKCC"),
("hkdd", "HKDD"),
("hkpd", "HKPD"),
("shctx", "SHCTX"),
],
);
register(
&["messagebox"],
&[
("mb_ok", "MB_OK"),
("mb_okcancel", "MB_OKCANCEL"),
("mb_abortretryignore", "MB_ABORTRETRYIGNORE"),
("mb_retrycancel", "MB_RETRYCANCEL"),
("mb_yesno", "MB_YESNO"),
("mb_yesnocancel", "MB_YESNOCANCEL"),
("mb_iconexclamation", "MB_ICONEXCLAMATION"),
("mb_iconinformation", "MB_ICONINFORMATION"),
("mb_iconquestion", "MB_ICONQUESTION"),
("mb_iconstop", "MB_ICONSTOP"),
("mb_usericon", "MB_USERICON"),
("mb_topmost", "MB_TOPMOST"),
("mb_setforeground", "MB_SETFOREGROUND"),
("mb_right", "MB_RIGHT"),
("mb_defbutton1", "MB_DEFBUTTON1"),
("mb_defbutton2", "MB_DEFBUTTON2"),
("mb_defbutton3", "MB_DEFBUTTON3"),
("mb_defbutton4", "MB_DEFBUTTON4"),
("idok", "IDOK"),
("idcancel", "IDCANCEL"),
("idyes", "IDYES"),
("idno", "IDNO"),
("idabort", "IDABORT"),
("idretry", "IDRETRY"),
("idignore", "IDIGNORE"),
],
);
register(
&["createshortcut", "showwindow"],
&[
("sw_shownormal", "SW_SHOWNORMAL"),
("sw_showmaximized", "SW_SHOWMAXIMIZED"),
("sw_showminimized", "SW_SHOWMINIMIZED"),
("sw_hide", "SW_HIDE"),
("sw_show", "SW_SHOW"),
],
);
register(
&["createshortcut"],
&[
("alt", "ALT"),
("control", "CONTROL"),
("ext", "EXT"),
("shift", "SHIFT"),
],
);
register(
&["setfileattributes"],
&[
("archive", "ARCHIVE"),
("hidden", "HIDDEN"),
("offline", "OFFLINE"),
("readonly", "READONLY"),
("system", "SYSTEM"),
("temporary", "TEMPORARY"),
],
);
register(
&["fileseek"],
&[("set", "SET"), ("cur", "CUR"), ("end", "END")],
);
register(
&["getwinver"],
&[
("major", "MAJOR"),
("minor", "MINOR"),
("build", "BUILD"),
("servicepack", "SERVICEPACK"),
],
);
register(
&["manifestsupportedos"],
&[
("winvista", "WinVista"),
("win7", "Win7"),
("win8", "Win8"),
("win8.1", "Win8.1"),
("win10", "Win10"),
],
);
register(&["changeui"], &[("dlg_id", "dlg_id")]);
builder
});