如何确保Powershell DSC安装确切版本的Installshield setup.exe

时间:2021-09-02 22:40:07

I'm trying out Powershell DSC as a way of automating deployments. We have an EXE installer created by Installshield for a server application, and need to ensure the latest version is installed.

我正在尝试使用Powershell DSC作为自动化部署的一种方式。我们有一个由Installshield为服务器应用程序创建的EXE安装程序,需要确保安装了最新版本。

Installshield guidelines (http://www.flexerasoftware.com/producer/resources/white-papers/is-msipatches.html) suggest that the Package Code should change for every build, the Product Code should stay the same between minor versions, and the Upgrade Code should always stays the same.

Installshield指南(http://www.flexerasoftware.com/producer/resources/white-papers/is-msipatches.html)建议包装代码应针对每个版本进行更改,产品代码应在次要版本之间保持不变,并且升级代码应始终保持不变。

Is there a way of telling Powershell DSC to install a particular minor version, i.e. to make sure that the Package Code matches exactly?

有没有办法告诉Powershell DSC安装一个特定的次要版本,即确保包装代码完全匹配?

I'm using the following to create the MOF, but when I run it, it detects the Product as already installed and doesn't do anything, even though it's a different Package.

我正在使用以下内容来创建MOF,但是当我运行它时,它会检测到已安装的产品并且没有做任何事情,即使它是一个不同的包。

Package MyApp
{
    Ensure = "Present"
    Name = "MyApp"
    Path = "\\path\to\specific\version\of\setup.exe"
    ProductId = ''
    Arguments = "/V`"ADDLOCAL=ALL /qb`""
}

1 个解决方案

#1


1  

The package resource will declare the resource as correctly configured if the package is already installed. So it will not work for your specific scenario. You will have to write a custom package resource or extend the existing one. If you want to modify feel free to fork this repository and extend the functionality https://github.com/PowerShell/xPSDesiredStateConfiguration You can also open an issue for someone to pick up and fix the same.

如果已安装软件包,软件包资源将声明资源正确配置。因此它不适用于您的特定方案。您必须编写自定义包资源或扩展现有资源。如果你想修改随意分叉这个存储库并扩展功能https://github.com/PowerShell/xPSDesiredStateConfiguration你也可以打开一个问题,让别人拿起并修复它。

#1


1  

The package resource will declare the resource as correctly configured if the package is already installed. So it will not work for your specific scenario. You will have to write a custom package resource or extend the existing one. If you want to modify feel free to fork this repository and extend the functionality https://github.com/PowerShell/xPSDesiredStateConfiguration You can also open an issue for someone to pick up and fix the same.

如果已安装软件包,软件包资源将声明资源正确配置。因此它不适用于您的特定方案。您必须编写自定义包资源或扩展现有资源。如果你想修改随意分叉这个存储库并扩展功能https://github.com/PowerShell/xPSDesiredStateConfiguration你也可以打开一个问题,让别人拿起并修复它。