2

I read about this question on referencing one project into another and this question on creating multiple targets for an application, but none really answers my question.

How can I output two different applications where the only difference is the application name, icon and splashscreen? Everything else would be the same apart from some small details that I handled with conditional compilation symbols.

I have four configurations: App1_Debug, App1_Release, App2_Debug and App2_Release, so ideally the output would be based on the active configuration.

Community
  • 1
  • 1
Thomas Joulin
  • 6,590
  • 9
  • 53
  • 88
  • This seems like something you could accomplish with MSBuild – William Melani Jan 27 '12 at 07:52
  • Have a look at this on Windows Phone UserVoice: http://windowsphone.uservoice.com/forums/101801-feature-suggestions/suggestions/2477622-dont-allow-to-publish-same-application-multiple-ti. "Spamming" the Marketplace is probably something you should avoid. (Not that I know you are "spamming" the Marketplace.) – Martin Liversage Jan 27 '12 at 08:52
  • @MartinLiversage I know, not planning to be evil here ;) My client is actually in a Microsoft program (they sponsor the apps), so I suppose they know that there will be two very similar apps. The web service used is of course different, and they already have iPhone versions which have been approved. – Thomas Joulin Jan 27 '12 at 09:09

2 Answers2

3

Note that it's probably useless to change the application name. The name you see on the phone is the name defined in the manifest, and the manifest is automatically generated from the information you provide when publishing the app on the marketplace.

Now to answer your question, you can inject a custom manifest and a custom splashscreen in your app using a post-build event: http://blogs.codes-sources.com/kookiz/archive/2012/01/12/wp7-inject-a-file-in-a-xap-using-post-build-event.aspx

Basically, create a folder in your solution, and put the custom manifest and splashcreen inside. Then define the post-build event of your configuration to inject the appropriate files. You can inject different files simply by setting different post-build events for each of your configuration (App1_Debug, App2_Debug, ...).

I don't know if it'll work for the icon. In the solution explorer, click on the icon, and check the properties. If its build action is set to 'Content' then it should work.

Kevin Gosse
  • 38,392
  • 3
  • 78
  • 94
  • Neat solution, thank you ! Since WPAppManifest.xml contains the paths to the icons, I just added my two different icons to my solution with different names and I replaced the WPAppManifest based on the configuration. I did not find how to set a different post-build event for each configuration so I just used "$(ConfigurationName)" in the path for my different manifests – Thomas Joulin Jan 27 '12 at 09:04
0

As you say your solution/projects already have this facility, its the compiling bit your missing.

If you Install a CI system (such as teamcity) to automate your builds. You could configure it so when you commit a change to your source control system each target will be compiled separately and stored as a separate artifact. http://www.jetbrains.com/teamcity/

ALternativly you could just drive your builds from the commandline/MSBuild and specify each target separately. And just have a short cut on your desktop to rebuild everything. MSBuild: Specifying a target from the command line

Community
  • 1
  • 1
JonAlb
  • 1,702
  • 10
  • 14