Skip to content
Tunisiano18 edited this page Oct 30, 2022 · 4 revisions

Detect OS type
Uninstall script

Use of chocolatey environment variables

Environment.SetEnvironmentVariable("chocolateyPackageName", package.Id);
Environment.SetEnvironmentVariable("packageName", package.Id);
Environment.SetEnvironmentVariable("chocolateyPackageVersion", package.Version.to_string());
Environment.SetEnvironmentVariable("packageVersion", package.Version.to_string());
Environment.SetEnvironmentVariable("chocolateyPackageFolder", packageDirectory);
Environment.SetEnvironmentVariable("packageFolder", packageDirectory);
Environment.SetEnvironmentVariable("installArguments", configuration.InstallArguments);
Environment.SetEnvironmentVariable("installerArguments", configuration.InstallArguments);
Environment.SetEnvironmentVariable("chocolateyInstallArguments", configuration.InstallArguments);
Environment.SetEnvironmentVariable("packageParameters", configuration.PackageParameters);
Environment.SetEnvironmentVariable("chocolateyPackageParameters", configuration.PackageParameters);
if (configuration.ForceX86) {
Environment.SetEnvironmentVariable("chocolateyForceX86", "true");
}
if (configuration.OverrideArguments) {
Environment.SetEnvironmentVariable("chocolateyInstallOverride", "true");
}
if (configuration.NotSilent) {
Environment.SetEnvironmentVariable("chocolateyInstallOverride", "true");
}
Clone this wiki locally