Skip uninstall validation if productCode empty (#40867)
Add an early return in preProcessUninstallScript to return the original uninstallScript when productCode is empty. This prevents calling file.ValidatePackageIdentifiers with an empty product code and avoids unnecessary validation errors.
This commit is contained in:
@@ -377,6 +377,9 @@ func buildUpgradeCodeBasedUninstallScript(upgradeCode string) (string, error) {
|
||||
}
|
||||
|
||||
func preProcessUninstallScript(uninstallScript, productCode string) (string, error) {
|
||||
if productCode == "" {
|
||||
return uninstallScript, nil
|
||||
}
|
||||
if err := file.ValidatePackageIdentifiers([]string{productCode}, ""); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user