diff --git a/.github/actions/spelling/allow.txt b/.github/actions/spelling/allow.txt index 0776f0427d..3ddf101827 100644 --- a/.github/actions/spelling/allow.txt +++ b/.github/actions/spelling/allow.txt @@ -422,3 +422,10 @@ Xlang XResource XTOKEN xunit +advancedinstaller +advinst +advinstexe +advinstmsi +aespassword +APPDIR +exenoui diff --git a/schemas/JSON/manifests/v1.10.0/manifest.installer.1.10.0.json b/schemas/JSON/manifests/v1.10.0/manifest.installer.1.10.0.json index 98da3b2c34..f8dccbfeab 100644 --- a/schemas/JSON/manifests/v1.10.0/manifest.installer.1.10.0.json +++ b/schemas/JSON/manifests/v1.10.0/manifest.installer.1.10.0.json @@ -65,7 +65,9 @@ "wix", "burn", "pwa", - "portable" + "portable", + "advinstExe", + "advinstMsi" ], "description": "Enumeration of supported installer types. InstallerType is required in either root level or individual Installer level" }, @@ -80,7 +82,9 @@ "nullsoft", "wix", "burn", - "portable" + "portable", + "advinstExe", + "advinstMsi" ], "description": "Enumeration of supported nested installer types contained inside an archive file" }, diff --git a/schemas/JSON/manifests/v1.10.0/manifest.singleton.1.10.0.json b/schemas/JSON/manifests/v1.10.0/manifest.singleton.1.10.0.json index dd48208c79..a7ab1a177e 100644 --- a/schemas/JSON/manifests/v1.10.0/manifest.singleton.1.10.0.json +++ b/schemas/JSON/manifests/v1.10.0/manifest.singleton.1.10.0.json @@ -167,7 +167,9 @@ "wix", "burn", "pwa", - "portable" + "portable", + "advinstExe", + "advinstMsi" ], "description": "Enumeration of supported installer types. InstallerType is required in either root level or individual Installer level" }, @@ -182,7 +184,9 @@ "nullsoft", "wix", "burn", - "portable" + "portable", + "advinstExe", + "advinstMsi" ], "description": "Enumeration of supported nested installer types contained inside an archive file" }, diff --git a/src/AppInstallerCLICore/Workflows/DownloadFlow.cpp b/src/AppInstallerCLICore/Workflows/DownloadFlow.cpp index 084cbb4d3f..18664e8eac 100644 --- a/src/AppInstallerCLICore/Workflows/DownloadFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/DownloadFlow.cpp @@ -48,9 +48,11 @@ namespace AppInstaller::CLI::Workflow case InstallerTypeEnum::Inno: case InstallerTypeEnum::Nullsoft: case InstallerTypeEnum::Portable: + case InstallerTypeEnum::AdvinstExe: return L".exe"sv; case InstallerTypeEnum::Msi: case InstallerTypeEnum::Wix: + case InstallerTypeEnum::AdvinstMsi: return L".msi"sv; case InstallerTypeEnum::Msix: // Note: We may need to distinguish between .msix and .msixbundle in the future. @@ -223,6 +225,8 @@ namespace AppInstaller::CLI::Workflow case InstallerTypeEnum::Portable: case InstallerTypeEnum::Wix: case InstallerTypeEnum::Zip: + case InstallerTypeEnum::AdvinstExe: + case InstallerTypeEnum::AdvinstMsi: context << DownloadInstallerFile; break; case InstallerTypeEnum::Msix: diff --git a/src/AppInstallerCLICore/Workflows/InstallFlow.cpp b/src/AppInstallerCLICore/Workflows/InstallFlow.cpp index e85540c379..2f33f516cb 100644 --- a/src/AppInstallerCLICore/Workflows/InstallFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/InstallFlow.cpp @@ -52,6 +52,8 @@ namespace AppInstaller::CLI::Workflow case InstallerTypeEnum::Msi: case InstallerTypeEnum::Nullsoft: case InstallerTypeEnum::Wix: + case InstallerTypeEnum::AdvinstExe: + case InstallerTypeEnum::AdvinstMsi: return true; default: return false; @@ -64,6 +66,7 @@ namespace AppInstaller::CLI::Workflow { case InstallerTypeEnum::Msi: case InstallerTypeEnum::Wix: + case InstallerTypeEnum::AdvinstMsi: return isSilentInstall || ExperimentalFeature::IsEnabled(ExperimentalFeature::Feature::DirectMSI); default: return false; @@ -406,6 +409,8 @@ namespace AppInstaller::CLI::Workflow case InstallerTypeEnum::Msi: case InstallerTypeEnum::Nullsoft: case InstallerTypeEnum::Wix: + case InstallerTypeEnum::AdvinstExe: + case InstallerTypeEnum::AdvinstMsi: if (doUninstallPrevious) { context << diff --git a/src/AppInstallerCLICore/Workflows/RepairFlow.cpp b/src/AppInstallerCLICore/Workflows/RepairFlow.cpp index 4bfc1d4a23..8ee05dbc14 100644 --- a/src/AppInstallerCLICore/Workflows/RepairFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/RepairFlow.cpp @@ -337,6 +337,7 @@ namespace AppInstaller::CLI::Workflow case InstallerTypeEnum::Burn: case InstallerTypeEnum::Inno: case InstallerTypeEnum::Nullsoft: + case InstallerTypeEnum::AdvinstExe: { context << RunRepairForRepairBehaviorBasedInstaller; @@ -344,6 +345,7 @@ namespace AppInstaller::CLI::Workflow break; case InstallerTypeEnum::Msi: case InstallerTypeEnum::Wix: + case InstallerTypeEnum::AdvinstMsi: { context << RepairMsiBasedInstaller; @@ -379,6 +381,7 @@ namespace AppInstaller::CLI::Workflow case InstallerTypeEnum::Exe: case InstallerTypeEnum::Inno: case InstallerTypeEnum::Nullsoft: + case InstallerTypeEnum::AdvinstExe: { context << GenerateRepairString; @@ -387,6 +390,7 @@ namespace AppInstaller::CLI::Workflow // MSI based installers, for installed package all gets mapped to msi extension. case InstallerTypeEnum::Msi: case InstallerTypeEnum::Wix: + case InstallerTypeEnum::AdvinstMsi: { context << SetProductCodesInContext; diff --git a/src/AppInstallerCLICore/Workflows/UninstallFlow.cpp b/src/AppInstallerCLICore/Workflows/UninstallFlow.cpp index ce12427900..061d52a99c 100644 --- a/src/AppInstallerCLICore/Workflows/UninstallFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/UninstallFlow.cpp @@ -220,6 +220,7 @@ namespace AppInstaller::CLI::Workflow case InstallerTypeEnum::Burn: case InstallerTypeEnum::Inno: case InstallerTypeEnum::Nullsoft: + case InstallerTypeEnum::AdvinstExe: { IPackageVersion::Metadata packageMetadata = installedPackageVersion->GetMetadata(); @@ -245,6 +246,7 @@ namespace AppInstaller::CLI::Workflow } case InstallerTypeEnum::Msi: case InstallerTypeEnum::Wix: + case InstallerTypeEnum::AdvinstMsi: { // Uninstall strings for MSI don't include UI level (/q) needed to avoid interactivity, // so we handle them differently. @@ -329,12 +331,14 @@ namespace AppInstaller::CLI::Workflow case InstallerTypeEnum::Burn: case InstallerTypeEnum::Inno: case InstallerTypeEnum::Nullsoft: + case InstallerTypeEnum::AdvinstExe: context << Workflow::ShellExecuteUninstallImpl << ReportUninstallerResult("UninstallString", APPINSTALLER_CLI_ERROR_EXEC_UNINSTALL_COMMAND_FAILED); break; case InstallerTypeEnum::Msi: case InstallerTypeEnum::Wix: + case InstallerTypeEnum::AdvinstMsi: context << Workflow::ShellExecuteMsiExecUninstall << ReportUninstallerResult("MsiExec", APPINSTALLER_CLI_ERROR_EXEC_UNINSTALL_COMMAND_FAILED); diff --git a/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp b/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp index 16e759441c..2cc9b7adb3 100644 --- a/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp +++ b/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp @@ -24,9 +24,11 @@ namespace AppInstaller::Manifest case InstallerTypeEnum::Nullsoft: case InstallerTypeEnum::Exe: case InstallerTypeEnum::Burn: + case InstallerTypeEnum::AdvinstExe: return CompatibilitySet::Exe; case InstallerTypeEnum::Wix: case InstallerTypeEnum::Msi: + case InstallerTypeEnum::AdvinstMsi: return CompatibilitySet::Msi; case InstallerTypeEnum::Msix: case InstallerTypeEnum::MSStore: @@ -162,6 +164,14 @@ namespace AppInstaller::Manifest { result = InstallerTypeEnum::Portable; } + else if (inStrLower == "advinstexe") + { + result = InstallerTypeEnum::AdvinstExe; + } + else if (inStrLower == "advinstmsi") + { + result = InstallerTypeEnum::AdvinstMsi; + } return result; } @@ -583,6 +593,10 @@ namespace AppInstaller::Manifest return "msstore"sv; case InstallerTypeEnum::Portable: return "portable"sv; + case InstallerTypeEnum::AdvinstExe: + return "advinstexe"sv; + case InstallerTypeEnum::AdvinstMsi: + return "advinstmsi"sv; } return "unknown"sv; @@ -888,7 +902,9 @@ namespace AppInstaller::Manifest installerType == InstallerTypeEnum::Nullsoft || installerType == InstallerTypeEnum::Wix || installerType == InstallerTypeEnum::Burn || - installerType == InstallerTypeEnum::Portable + installerType == InstallerTypeEnum::Portable || + installerType == InstallerTypeEnum::AdvinstExe || + installerType == InstallerTypeEnum::AdvinstMsi ); } @@ -901,7 +917,9 @@ namespace AppInstaller::Manifest installerType == InstallerTypeEnum::Nullsoft || installerType == InstallerTypeEnum::Wix || installerType == InstallerTypeEnum::Burn || - installerType == InstallerTypeEnum::Portable + installerType == InstallerTypeEnum::Portable || + installerType == InstallerTypeEnum::AdvinstExe || + installerType == InstallerTypeEnum::AdvinstMsi ); } @@ -913,7 +931,9 @@ namespace AppInstaller::Manifest installerType == InstallerTypeEnum::Msi || installerType == InstallerTypeEnum::Nullsoft || installerType == InstallerTypeEnum::Wix || - installerType == InstallerTypeEnum::Burn + installerType == InstallerTypeEnum::Burn || + installerType == InstallerTypeEnum::AdvinstExe || + installerType == InstallerTypeEnum::AdvinstMsi ); } @@ -939,7 +959,8 @@ namespace AppInstaller::Manifest installerType == InstallerTypeEnum::Burn || installerType == InstallerTypeEnum::Inno || installerType == InstallerTypeEnum::Nullsoft || - installerType == InstallerTypeEnum::Exe; + installerType == InstallerTypeEnum::Exe || + installerType == InstallerTypeEnum::AdvinstExe; } bool IsArchiveType(InstallerTypeEnum installerType) @@ -962,7 +983,9 @@ namespace AppInstaller::Manifest nestedInstallerType == InstallerTypeEnum::Wix || nestedInstallerType == InstallerTypeEnum::Burn || nestedInstallerType == InstallerTypeEnum::Portable || - nestedInstallerType == InstallerTypeEnum::Msix + nestedInstallerType == InstallerTypeEnum::Msix || + nestedInstallerType == InstallerTypeEnum::AdvinstExe || + nestedInstallerType == InstallerTypeEnum::AdvinstMsi ); } @@ -1021,6 +1044,22 @@ namespace AppInstaller::Manifest {InstallerSwitchType::Log, ManifestInstaller::string_t("/LOG=\"" + std::string(ARG_TOKEN_LOGPATH) + "\"")}, {InstallerSwitchType::InstallLocation, ManifestInstaller::string_t("/DIR=\"" + std::string(ARG_TOKEN_INSTALLPATH) + "\"")} }; + case InstallerTypeEnum::AdvinstExe: + return + { + {InstallerSwitchType::Silent, ManifestInstaller::string_t("/exenoui /quiet /norestart")}, + {InstallerSwitchType::SilentWithProgress, ManifestInstaller::string_t("/exenoui /passive /norestart")}, + {InstallerSwitchType::Log, ManifestInstaller::string_t("/log \"" + std::string(ARG_TOKEN_LOGPATH) + "\"")}, + {InstallerSwitchType::InstallLocation, ManifestInstaller::string_t("APPDIR=\"" + std::string(ARG_TOKEN_INSTALLPATH) + "\"")} + }; + case InstallerTypeEnum::AdvinstMsi: + return + { + {InstallerSwitchType::Silent, ManifestInstaller::string_t("/quiet /norestart")}, + {InstallerSwitchType::SilentWithProgress, ManifestInstaller::string_t("/passive /norestart")}, + {InstallerSwitchType::Log, ManifestInstaller::string_t("/log \"" + std::string(ARG_TOKEN_LOGPATH) + "\"")}, + {InstallerSwitchType::InstallLocation, ManifestInstaller::string_t("APPDIR=\"" + std::string(ARG_TOKEN_INSTALLPATH) + "\"")} + }; default: return {}; } @@ -1054,6 +1093,7 @@ namespace AppInstaller::Manifest case InstallerTypeEnum::Burn: case InstallerTypeEnum::Wix: case InstallerTypeEnum::Msi: + case InstallerTypeEnum::AdvinstMsi: // See https://docs.microsoft.com/windows/win32/msi/error-codes return { @@ -1104,6 +1144,32 @@ namespace AppInstaller::Manifest { HRESULT_FROM_WIN32(ERROR_DEPLOYMENT_OPTION_NOT_SUPPORTED), ExpectedReturnCodeEnum::SystemNotSupported }, { HRESULT_FROM_WIN32(ERROR_PACKAGE_LACKS_CAPABILITY_TO_DEPLOY_ON_HOST), ExpectedReturnCodeEnum::SystemNotSupported }, }; + case InstallerTypeEnum::AdvinstExe: + // See https://www.advancedinstaller.com/user-guide/exe-setup-file.html + return + { + { ERROR_INSTALL_ALREADY_RUNNING, ExpectedReturnCodeEnum::InstallInProgress }, + { ERROR_DISK_FULL, ExpectedReturnCodeEnum::DiskFull }, + { ERROR_INSTALL_SERVICE_FAILURE, ExpectedReturnCodeEnum::ContactSupport }, + { ERROR_SUCCESS_REBOOT_REQUIRED, ExpectedReturnCodeEnum::RebootRequiredToFinish }, + { ERROR_SUCCESS_REBOOT_INITIATED, ExpectedReturnCodeEnum::RebootInitiated }, + { ERROR_INSTALL_USEREXIT, ExpectedReturnCodeEnum::CancelledByUser }, + { ERROR_PRODUCT_VERSION, ExpectedReturnCodeEnum::AlreadyInstalled }, + { ERROR_INSTALL_REJECTED, ExpectedReturnCodeEnum::SystemNotSupported }, + { ERROR_INSTALL_PACKAGE_REJECTED, ExpectedReturnCodeEnum::BlockedByPolicy }, + { ERROR_INSTALL_TRANSFORM_REJECTED, ExpectedReturnCodeEnum::BlockedByPolicy }, + { ERROR_PATCH_PACKAGE_REJECTED, ExpectedReturnCodeEnum::BlockedByPolicy }, + { ERROR_PATCH_REMOVAL_DISALLOWED, ExpectedReturnCodeEnum::BlockedByPolicy }, + { ERROR_INSTALL_REMOTE_DISALLOWED, ExpectedReturnCodeEnum::BlockedByPolicy }, + { ERROR_INVALID_PARAMETER, ExpectedReturnCodeEnum::InvalidParameter }, + { ERROR_INVALID_TABLE, ExpectedReturnCodeEnum::InvalidParameter }, + { ERROR_INVALID_COMMAND_LINE, ExpectedReturnCodeEnum::InvalidParameter }, + { ERROR_INVALID_PATCH_XML, ExpectedReturnCodeEnum::InvalidParameter }, + { ERROR_INSTALL_LANGUAGE_UNSUPPORTED, ExpectedReturnCodeEnum::SystemNotSupported }, + { ERROR_INSTALL_PLATFORM_UNSUPPORTED, ExpectedReturnCodeEnum::SystemNotSupported }, + { -1, ExpectedReturnCodeEnum::CancelledByUser } + //1, when EXE bootstrapper is launched with wrong value for /aespassword parameter + }; default: return {}; } diff --git a/src/AppInstallerCommonCore/Public/winget/ManifestCommon.h b/src/AppInstallerCommonCore/Public/winget/ManifestCommon.h index dc6b83bc2b..d4af2c1344 100644 --- a/src/AppInstallerCommonCore/Public/winget/ManifestCommon.h +++ b/src/AppInstallerCommonCore/Public/winget/ManifestCommon.h @@ -100,6 +100,8 @@ namespace AppInstaller::Manifest Burn, MSStore, Portable, + AdvinstExe, + AdvinstMsi }; enum class UpdateBehaviorEnum diff --git a/src/AppInstallerRepositoryCore/Rest/Schema/1_0/Json/ManifestDeserializer_1_0.cpp b/src/AppInstallerRepositoryCore/Rest/Schema/1_0/Json/ManifestDeserializer_1_0.cpp index 7b0184210d..8549de7281 100644 --- a/src/AppInstallerRepositoryCore/Rest/Schema/1_0/Json/ManifestDeserializer_1_0.cpp +++ b/src/AppInstallerRepositoryCore/Rest/Schema/1_0/Json/ManifestDeserializer_1_0.cpp @@ -531,6 +531,14 @@ namespace AppInstaller::Repository::Rest::Schema::V1_0::Json { return InstallerTypeEnum::Burn; } + else if (inStrLower == "advinstexe") + { + return InstallerTypeEnum::AdvinstExe; + } + else if (inStrLower == "advinstmsi") + { + return InstallerTypeEnum::AdvinstMsi; + } return InstallerTypeEnum::Unknown; } diff --git a/src/Microsoft.Management.Deployment/Converters.cpp b/src/Microsoft.Management.Deployment/Converters.cpp index 08338dd306..46de01ea9a 100644 --- a/src/Microsoft.Management.Deployment/Converters.cpp +++ b/src/Microsoft.Management.Deployment/Converters.cpp @@ -285,6 +285,10 @@ namespace winrt::Microsoft::Management::Deployment::implementation return Microsoft::Management::Deployment::PackageInstallerType::Wix; case ::AppInstaller::Manifest::InstallerTypeEnum::Zip: return Microsoft::Management::Deployment::PackageInstallerType::Zip; + case ::AppInstaller::Manifest::InstallerTypeEnum::AdvinstExe: + return Microsoft::Management::Deployment::PackageInstallerType::AdvinstExe; + case ::AppInstaller::Manifest::InstallerTypeEnum::AdvinstMsi: + return Microsoft::Management::Deployment::PackageInstallerType::AdvinstMsi; case ::AppInstaller::Manifest::InstallerTypeEnum::Unknown: return Microsoft::Management::Deployment::PackageInstallerType::Unknown; } @@ -316,6 +320,10 @@ namespace winrt::Microsoft::Management::Deployment::implementation return ::AppInstaller::Manifest::InstallerTypeEnum::Wix; case Microsoft::Management::Deployment::PackageInstallerType::Zip: return ::AppInstaller::Manifest::InstallerTypeEnum::Zip; + case Microsoft::Management::Deployment::PackageInstallerType::AdvinstExe: + return ::AppInstaller::Manifest::InstallerTypeEnum::AdvinstExe; + case Microsoft::Management::Deployment::PackageInstallerType::AdvinstMsi: + return ::AppInstaller::Manifest::InstallerTypeEnum::AdvinstMsi; case Microsoft::Management::Deployment::PackageInstallerType::Unknown: return ::AppInstaller::Manifest::InstallerTypeEnum::Unknown; } diff --git a/src/Microsoft.Management.Deployment/PackageManager.idl b/src/Microsoft.Management.Deployment/PackageManager.idl index 943177fc45..124e3e8416 100644 --- a/src/Microsoft.Management.Deployment/PackageManager.idl +++ b/src/Microsoft.Management.Deployment/PackageManager.idl @@ -467,6 +467,10 @@ namespace Microsoft.Management.Deployment MSStore, /// Portable type. Portable, + /// AdvancedInstaller exe type. + AdvinstExe, + /// AdvancedInstaller msi type. + AdvinstMsi, }; /// The package installer scope.