Performing Web.config Transforms after installing an MSI package


We have a VS solution with a setup project that generates an MSI installer when we build it. We pack the MSI, as well as some other necessary files, in a NuGet package using the pack method in the octo.exe utility, and then push it to the Octopus server. As a part of our deployment process, I would like to perform a Web.config transform once the MSI has been installed. However, as far as I understand, this is not possible as the transformation can only be done as part of the “Deploy Package” step. Is this a correct understanding? Unfortunately, at the present time it is not an option for us to use OctoPack when building the application.

Would it be possible to script the transformation using Powershell instead and add it as a separate step after the MSI is installed, or are there other ways to get this done in Octopus?


Thanks for reaching out. It’s not possible from Octopus to make the transformations from outside of the deployment step, you are correct on that. I’m gonna assume that your MSI installs something that needs the web.config to work (let’s say a website). Do you think the following process might work?

(all of the above happens on the same NuGet deployment step)

  1. Octopus unpacks the package, leaving the MSI and the web.config exposed on the working directory
  2. Octopus will run the transformations on the web.config file, and leave it on the working directory
  3. Using a “Deploy Script”, run the MSI to install you app
  4. Using a “Post-Deploy script”, copy the transformed Web.config from the working directory to wherever you need it.

Let me know if that makes sense to you and your scenario.



Hi Dalmiro,

That is exactly the same process I ended up using - except that I split it up in 4 steps rather than putting everything in the NuGet deployment step.