Managing the Free version of my app
Asked Answered
M

4

10

My paid app has been published on the WP7 marketplace. Now I would like to create a free version of the app.

I figure I would have a constant IsFreeVersion = true; and then based on that disable some functionality.

What would be the best approach to setting up my project for this? I definitely do not want to have two versions of the code. So should I create a new project and link the files?

Also, how do I handle the different application icons? Finally, wouldn't I need a separate GUID for my application Id?

Matrona answered 21/6, 2011 at 18:6 Comment(0)
A
5

If you want separate apps for the free and paid versions (Presumably you're limiting the functionality of the free app or adding ads) then I'd create a separate project and then link to the exisiting files of the other (use "add as link").

You can then customize the different versions as necessary. When doing things like this I like to use partial methods (and classes) to extend and customize the different versions.
You may also want to use app specific compiler directives to limit functionality to a specific version.

Austere answered 21/6, 2011 at 19:47 Comment(4)
FWIW, Compiler directives will be easiest. You simply define a ISFREEVERSION directive in the project settings (of the free version), and then simply add #else ISFREEVERSION ... #else ... #endif (it works great!)Leela
Thank you Matt! This approach allows me to have a unique GUID for the project, new icon for the app and not have to duplicate my code!Matrona
@Leela thata's only good up to a point. It doesn't help you have different project properties, images, etc.Austere
Agreed. but for me it gets to about 90% of the problems I might have.. (Anyway, if it wasn't clear I was telling the Andy that, IMO, yours was the right solution).. it's really handy to be able to share the code...Leela
P
17

If you want to have a Free and Paid version of your app in the same project without using a 'Trial' version, this is how I do it:

Each project is assigned a single ProductID which distinguishes the app from other apps at install time. You could create a second project and link to all the files in the first project, but that would require maintenance as the project grows. My solution allows using the Build Configuration to select the free or paid app to build.

First you need a separate ProductID for each version of the app. This ProductID is declared in the manifest file 'Properties/WMAAppManifest.xml'. So the first step is to create two versions of WMAAppManifest.xml. I call them WMAAppManifestPaid.xml and WMAAppManifestFree.xml.

In each of these manifest files, provide a separate GUID for the ProductID and also change the Title of the free version so you can tell them apart when they are installed.

Next we need to add two new Build Configurations in the project. I call them ReleaseFree and DebugFree.

Next you add a few Pre-Build Events to all the build configuations to copy the appropriate manifest file:

if $(ConfigurationName)==Release copy $(ProjectDir)\Properties\WMAppManifestPaid.xml $(ProjectDir)\Properties\WMAppManifest.xml if $(ConfigurationName)==Debug copy $(ProjectDir)\Properties\WMAppManifestPaid.xml $(ProjectDir)\Properties\WMAppManifest.xml if $(ConfigurationName)==ReleaseFree copy $(ProjectDir)\Properties\WMAppManifestFree.xml $(ProjectDir)\Properties\WMAppManifest.xml if $(ConfigurationName)==DebugFree copy $(ProjectDir)\Properties\WMAppManifestFree.xml $(ProjectDir)\Properties\WMAppManifest.xml

You should now be able to build either the free or paid versions of the app by simply changing the Build Configuration.

Next, to allow for actually making the free version different than the paid version, such as limiting features, showing different pages etc., you need to add a Conditional Compilation Symbol, such as FREE_VERSION to the two free build configurations.

then you can simply use compiler directives to change the code such as:

#if FREE_VERSION
    s = "My App Free";
#else
    s = "My App Paid";
#endif
Percolator answered 29/1, 2012 at 23:44 Comment(4)
Perfect - exactly what I need. Linking files would be a maintainance nightmare for my case.Cocke
I realize this is old but project linker is pretty nice, msdn.microsoft.com/en-us/library/ff648745.aspxAnecdotist
Thank you so much for this, saved me a lot of troubles trying to maintain two code bases!! :)Calculus
One thing I have noticed. I had to put quotes around "$(ProjectDir)Properties\WMAppManifestPaid.xml" and all the other paths since there might be spaces in them. Also I removed the "/" btw $(ProjectDir) and PropertiesCalculus
A
5

If you want separate apps for the free and paid versions (Presumably you're limiting the functionality of the free app or adding ads) then I'd create a separate project and then link to the exisiting files of the other (use "add as link").

You can then customize the different versions as necessary. When doing things like this I like to use partial methods (and classes) to extend and customize the different versions.
You may also want to use app specific compiler directives to limit functionality to a specific version.

Austere answered 21/6, 2011 at 19:47 Comment(4)
FWIW, Compiler directives will be easiest. You simply define a ISFREEVERSION directive in the project settings (of the free version), and then simply add #else ISFREEVERSION ... #else ... #endif (it works great!)Leela
Thank you Matt! This approach allows me to have a unique GUID for the project, new icon for the app and not have to duplicate my code!Matrona
@Leela thata's only good up to a point. It doesn't help you have different project properties, images, etc.Austere
Agreed. but for me it gets to about 90% of the problems I might have.. (Anyway, if it wasn't clear I was telling the Andy that, IMO, yours was the right solution).. it's really handy to be able to share the code...Leela
U
4

The Trial API is designed to handle such a situation. You can check if IsTrial is true, in which case you can limit functionality all in one code base. I assume you avoided this in order to ensure your app appears in the Free section of the Marketplace. In this case, you'll have to submit it as a new app, which means a new GUID.

AFAIK (maybe someone has another method), you'll have to create a new project and run a separate build. You can include your existing code base for the most part, but you'll end up with two versions if you don't include the Trial API. Since it's a new project, you can change the tile icons to whatever you want.

Useful answered 21/6, 2011 at 18:32 Comment(0)
K
1

Jeff Brand has also prepared a very nice TrialManager library which allows you to implement different types of trial management.

Scenarios like:

  • Expires after N number of use
  • Expires after T minutes of use
  • ...

http://www.slickthought.net/post/2010/08/30/Managing-Trial-Applications-for-Windows-Phone-7.aspx

Kandis answered 21/6, 2011 at 19:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.