简体   繁体   English

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

[英]How to ensure exact version of Installshield setup.exe is installed by Powershell DSC

I'm trying out Powershell DSC as a way of automating deployments. 我正在尝试使用Powershell DSC作为自动化部署的方法。 We have an EXE installer created by Installshield for a server application, and need to ensure the latest version is installed. 我们有一个由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, ie 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,也不会执行任何操作。

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

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您还可以为其他人打开并修复它的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM