What is the best way to publish multiple versions of the same ClickOnce application?

前端 未结 3 566
小蘑菇
小蘑菇 2021-01-16 12:31

I have a c# ClickOnce application that I need to be able to publish multiple times for OEM purposes.

The way I understand it now is that publish settings are located

相关标签:
3条回答
  • 2021-01-16 13:06

    I wish I could give you some brilliant solution, but personally I would probably go with option 3.

    I mean, its pretty simple, the changes should be pretty static and it will be difficult(ish) to totally screw it up and deploy the wrong changes to the wrong company.

    0 讨论(0)
  • 2021-01-16 13:16

    I found that you are able to edit certain properties using MSBuild.exe like this

    MSBuild Solution.sln /target:publish /property:ProductName=ProductA\;Publisher=CompanyA\;ApplicationIcon=companyA.ico

    I found another useful post on modifying.csproj files programatically with .NET code. (This would only be needed if you're modifying things that are deeper than just the project properties specified in the ClickOnce documentation below)

    The MSBuild documentation here was also useful -- especially under Publishing Properties

    0 讨论(0)
  • 2021-01-16 13:21

    If you copy the .csproj in your project folder, it will reference all of the same source files and you can just change the executable name. Create another VS solution and you can reference the copied .csproj and get rid of your first one so that you can publish two separate versions.

    This isn't ideal for ClickOnce however.

    If you use a Singleton object that specifies the "mode" (Company A, B, C, etc.) you can easily store that in the app.config (or another xml file). Then just re-publish your ClickOnce Application but copy the correct version of your configuration file in so it gets shipped with the build. This way, you don't need any additional csprojects Just include all of your icons and set them at run-time on App Start based on your Singleton object.

    0 讨论(0)
提交回复
热议问题