5

How can I deploy more than one WP7 app with the same Visual Studio solution? What do I need to change to achieve this? Changing Xap file name and assembly GUID and title does not achieve it. In fact VS overrides the old one with new title but does not deploy a separate app

Background: We have a Lite and Pro app and I want to be able to deploy both versions onto the phone.

EDIT:

Trial API is not an option for us. We have thought about that but decided to not use it.

Buju
  • 1,546
  • 3
  • 16
  • 27
  • Is the Lite and Pro the same project? If they are different projects, then just build or deploy the projects, and then look in the bin folders for that project. – Martin Mar 14 '11 at 15:25
  • 4
    Why not use the [Trial mode API](http://devlicio.us/blogs/derik_whittaker/archive/2010/10/18/enabling-your-wp7-application-to-be-installed-in-trial-mode.aspx) to accomplish this within the same app? Much easier for your users to go from Lite to Pro. – theChrisKent Mar 14 '11 at 15:29
  • I totally agree with @theChrisKent - don't litter the marketplace with "Lite" apps when there's a perfectly good system for trials in place. – Richard Szalay Mar 14 '11 at 15:34
  • 2
    as far as I know, if you use trial mode you won't be shown in the "free apps" category right? – Buju Mar 15 '11 at 10:21
  • 1
    That's correct--plenty of motivation to make a Free version of the app rather than go with the Trial mode API. – johnhforrest Apr 29 '11 at 15:45

5 Answers5

5

I have created prebuild events, which is based on the current configuration name. This event replaces the app configuration (WMAppManifest.xml, SplashScreenImage.jpg) in the solution.

Example:

echo "$(ConfigurationName)"

if "$(ConfigurationName)" == "Lite" goto :copyLite
if "$(ConfigurationName)" == "PRO" goto :copyPro

echo "Unknown Configuration"
goto :end

:copyLite
echo "copy lite"
  copy "$(ProjectDir)Resources\PreBuildEvent\Lite\WMAppManifest.xml" "$(ProjectDir)\Properties\" /y
  copy "$(ProjectDir)SplashScreenImageLite.jpg" "$(ProjectDir)SplashScreenImage.jpg" /y
goto :end

:copyPro
echo "copy pro"
  copy "$(ProjectDir)Resources\PreBuildEvent\Pro\WMAppManifest.xml" "$(ProjectDir)\Properties\" /y
  copy "$(ProjectDir)SplashScreenImagePro.jpg" "$(ProjectDir)SplashScreenImage.jpg" /y

goto :end

:end
1

I would recommend you consider the Trial API. It's the preferred WP7 implementation for what you are trying to accomplish. But if you have a need to achieve two apps that share resources, I would recommend you structure your solution into multiple projects. Each phone application should be its own project. Then create class projects that share elements among both "applications". Each phone project will compile into a separate "application".

Greg Zimmers
  • 1,390
  • 10
  • 6
1

If you want to achieve two different XAP installations from the same project, then you only need to change the Title and ProductID GUID information inside the Properties/WMAppManifest.xml file - although you will probably also want to change other things too - e.g. the icons, the splashscreen and some "about" information

Stuart
  • 66,722
  • 7
  • 114
  • 165
  • I tried that, as I have said above and it didn't work. it overwrites the old one ... – Buju Mar 15 '11 at 09:06
  • Just checking - above you said you'd changed the Assembly Guid - that's the Guid in the cs properties file - which is different to the one in the WMAppManifest.xml file. – Stuart Mar 15 '11 at 09:14
  • And now the big question... does it help? – Stuart Mar 15 '11 at 11:02
  • YES IT WORKS. For idiots - find this on like 3rd row of WMAppManifest.xml (xml file inside properties folder, and has the WM in front of it)- – Jon Jan 25 '12 at 17:00
  • thanks Jon :) I think the prebuild one does the same thing - just automates it. – Stuart Jan 25 '12 at 19:18
0

If the two apps are different projects within the same solution you can control which ones get deployed on a build using the configuration manager.

If you 're not puting multiple related projects int eh same solution, consider tyring it. I find this a great way of managing multiple related projects.

Matt Lacey
  • 65,560
  • 11
  • 91
  • 143
0

You can choose to deploy the entire solution or just the current startup project in the Build menu. If they are not both part of the same solution, then, no, you can't do that. But you could write a command line script that uses the deployment tool, perhaps?

i_am_jorf
  • 53,608
  • 15
  • 131
  • 222