Deployments via MSI

Hi,

We have a windows application, which we want to deploy the test servers using Octopus. Currently we are creating “msi” for that application then packaging it into a nuget package and pushing to a repository, which is connected to Octopus and we can deploy the package to the server and install the msi. But once the package is deployed to a server and you want to deploy it again then we need to manually uninstall the msi from control panel and then deploy it via Octopus again.

Is there a better way to do this ? Probably automated ?

Thanks
MY

Hi there

Thanks for getting in touch!

You can easily uninstall an MSI from a powershell script - its usually something like:

msiexec.exe /x $msiPath /quiet /l*v $msiLog

(an example of this in practice can be found of how we do it in the OctopusDSC project)

Hope that helps!

Regards,
Matt

Thanks for the help @matt but using this we are getting “error 27519”

“Error 27519.Error updating XML file C:\Program Files (x86)\XXX.exe.config. -2147024891”

this comes in a pop up with three options “Retry” “Abort” & “Ignore” we want to handle this by choosing ignore option that too with powershell.

Hi there

I’m not sure how you can pass that flag in, if its possible at all. I would suggest resolving the issue within the msi, so that it doesn’t show the error.

You should be able to look at the log file to understand a bit more about whats gone wrong.

I think this will end up being a bunch of trial and error here. Try to figure out how to get the uninstall to work from a command line, and then put that into the powershell.

Hope that helps!

Regards,
Matt