0

I'm just starting out with WiX and I would really appreciate some advice.

I've created a WiX project which installs a couple of Windows services, but I need to set the service name, username/password and .config file xml differently, depending on the environment. The environment is set in the UI via radio buttons, i.e. ENVIRONMENT gets set to PROD, UAT or SYSTEST.

I'm now not sure how to go about making the environment related changes. Should I create a component with a condition for each environment? That would mean a lot of duplication though, maybe there's a more elegant solution? Is there anything I need to be aware of (I’ve read that the service might not uninstall if I customise the name?).

Thanks!

Wim Coenen
  • 66,094
  • 13
  • 157
  • 251

1 Answers1

0

Since there's no answer to this yet, I thought I'd say what I've ended up doing.

Having a condition on every component repeating for every environment would have been a nightmare to maintain, so I decided to put all the environment related properties in a VBscript custom action. I had to persist it to the registry and retrieved it during an uninstall\upgrade when the UI isn't available, but initially it seemed to work quite well.

I had a problem as soon as I told it to start the services on install - it didn't recognise the fact the service was running when the uninstall ran and it though up window telling me the files were locked. From the log, it had correctly retrieved the service name so I couldn't figure out why, but it was definitely down to the service name not being in the msi table.

It was all getting a bit complicated and messy (and confusing for a beginner!), so I decided to try a different approach based on a an excellent post here WiX tricks and tips - Creating Live, Test, Training, ... versions using the same source files.

It's working really well and makes handling upgrades across different branches (sharing the same env) much easier too.

The only downside is the build time has increased a fair bit, but it's not a problem. Hope this is useful to someone.

Community
  • 1
  • 1