Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advinst as another default installer #5060

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/actions/spelling/allow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -422,3 +422,10 @@ Xlang
XResource
XTOKEN
xunit
advancedinstaller
advinst
advinstexe
advinstmsi
aespassword
APPDIR
exenoui
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -80,7 +82,9 @@
"nullsoft",
"wix",
"burn",
"portable"
"portable",
"advinstExe",
"advinstMsi"
],
"description": "Enumeration of supported nested installer types contained inside an archive file"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -182,7 +184,9 @@
"nullsoft",
"wix",
"burn",
"portable"
"portable",
"advinstExe",
"advinstMsi"
],
"description": "Enumeration of supported nested installer types contained inside an archive file"
},
Expand Down
4 changes: 4 additions & 0 deletions src/AppInstallerCLICore/Workflows/DownloadFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions src/AppInstallerCLICore/Workflows/InstallFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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 <<
Expand Down
4 changes: 4 additions & 0 deletions src/AppInstallerCLICore/Workflows/RepairFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,15 @@ namespace AppInstaller::CLI::Workflow
case InstallerTypeEnum::Burn:
case InstallerTypeEnum::Inno:
case InstallerTypeEnum::Nullsoft:
case InstallerTypeEnum::AdvinstExe:
{
context <<
RunRepairForRepairBehaviorBasedInstaller;
}
break;
case InstallerTypeEnum::Msi:
case InstallerTypeEnum::Wix:
case InstallerTypeEnum::AdvinstMsi:
{
context <<
RepairMsiBasedInstaller;
Expand Down Expand Up @@ -379,6 +381,7 @@ namespace AppInstaller::CLI::Workflow
case InstallerTypeEnum::Exe:
case InstallerTypeEnum::Inno:
case InstallerTypeEnum::Nullsoft:
case InstallerTypeEnum::AdvinstExe:
{
context <<
GenerateRepairString;
Expand All @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/AppInstallerCLICore/Workflows/UninstallFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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.
Expand Down Expand Up @@ -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);
Expand Down
76 changes: 71 additions & 5 deletions src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
);
}

Expand All @@ -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
);
}

Expand All @@ -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
);
}

Expand All @@ -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)
Expand All @@ -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
);
}

Expand Down Expand Up @@ -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 {};
}
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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 {};
}
Expand Down
2 changes: 2 additions & 0 deletions src/AppInstallerCommonCore/Public/winget/ManifestCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ namespace AppInstaller::Manifest
Burn,
MSStore,
Portable,
AdvinstExe,
AdvinstMsi
};

enum class UpdateBehaviorEnum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 8 additions & 0 deletions src/Microsoft.Management.Deployment/Converters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 4 additions & 0 deletions src/Microsoft.Management.Deployment/PackageManager.idl
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,10 @@ namespace Microsoft.Management.Deployment
MSStore,
/// Portable type.
Portable,
/// AdvancedInstaller exe type.
AdvinstExe,
/// AdvancedInstaller msi type.
AdvinstMsi,
};

/// The package installer scope.
Expand Down
Loading