Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setup project Conditional deploy of config files with the same name

Status
Not open for further replies.

Qik3Coder

Programmer
Jan 4, 2006
1,487
US
Ok. So, I have a setup project that writes out the "primary output" and some other files.
I have EXCLUDED the app.config that is automagically renamed to MyApp.exe.config.
In addition i have 3 config files, (Dev/Stg/Prd).exe.config
I have their target names set to MyApp.exe.config

I have added a 3 radio button screen to the installation process.
I added conditions (on the 3 config files ) that check the selected radio button value.

The aim is that the user selects one of the 3 radio buttons (you guessed it)
Development / Staging / Production and the appropriate config file is written out to the application folder.



Here's the problem:

If the targetname of the config files are set to anything other than MyApp.exe.config it will output the correct version of the file.

When I set the target name of (all) the config files to MyApp.config.exe it only outputs the config file when I select the 3rd radio button.


I don't care what messed up steps i have to take to make this work, I'm just looking for some way to beat this into submission.

(And whoever has the I hate Microsoft forever..., I agree with you)

-Sometimes the answer to your question is the hack that works
 
Why don't you create 3 setup projects? Perhaps that was a silly question, but I use Finalbuilder to build my projects And I can choose what it does in great detail. Among them the option to have different config files or just alter file when compilling. And why not make it an option at runtime.

Just trying to understand?


Christiaan Baes
Belgium

My Blog
 
It's in-house code, the installer gets run 1x a month, on 3 different boxes. The "happy path" calls for one installer. It used to just be an XCopy deployment, but we moved to TFS, and this is an interim solution till I wrap my head around WiX next month.

The only thing different about the 3 installs are the connection strings in the config file.




-Sometimes the answer to your question is the hack that works
 
Ok, so it's not based on the number of the selection, its whether or not it's the last one in list of files to deploy (WHAT THE HECK!)

if i rename the files in an order that changes which file is at the end of the other configs, then THAT one is the one that works.

-Sometimes the answer to your question is the hack that works
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top