管理我的应用程序的免费版本

发布于 2024-11-16 15:27:46 字数 226 浏览 4 评论 0 原文

我的付费应用程序已发布在 WP7 市场上。现在我想创建该应用程序的免费版本。

我想我会有一个常量 IsFreeVersion = true; ,然后基于此禁用某些功能。

为此设置我的项目的最佳方法是什么?我绝对不想有两个版本的代码。那么我应该创建一个新项目并链接文件吗?

另外,如何处理不同的应用程序图标?最后,我的应用程序 ID 不需要一个单独的 GUID 吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

尤怨 2024-11-23 15:27:46

如果您想在同一个项目中拥有应用程序的免费和付费版本而不使用“试用”版本,我就是这样做的:

每个项目都分配有一个 ProductID,用于在安装时将该应用程序与其他应用程序区分开来。您可以创建第二个项目并链接到第一个项目中的所有文件,但这需要随着项目的增长进行维护。我的解决方案允许使用构建配置来选择要构建的免费或付费应用程序。

首先,您需要为应用程序的每个版本提供单独的 ProductID。此 ProductID 在清单文件“Properties/WMAAppManifest.xml”中声明。因此第一步是创建两个版本的 WMAAppManifest.xml。我将它们称为 WMAAppManifestPaid.xml 和 WMAAppManifestFree.xml。

在每个清单文件中,为 ProductID 提供单独的 GUID,并更改免费版本的标题,以便您可以在安装时区分它们。

接下来我们需要在项目中添加两个新的构建配置。我称它们为 ReleaseFree 和 DebugFree。

接下来,向所有构建配置添加一些预构建事件以复制相应的清单文件:

if $(ConfigurationName)==Release copy $(ProjectDir)\Properties\WMAppManifestPaid.xml $(ProjectDir)\Properties\WMAppManifest.xml
如果 $(ConfigurationName)==调试副本 $(ProjectDir)\Properties\WMAppManifestPaid.xml $(ProjectDir)\Properties\WMAppManifest.xml
如果 $(ConfigurationName)==ReleaseFree 复制 $(ProjectDir)\Properties\WMAppManifestFree.xml $(ProjectDir)\Properties\WMAppManifest.xml
if $(ConfigurationName)==DebugFree copy $(ProjectDir)\Properties\WMAppManifestFree.xml $(ProjectDir)\Properties\WMAppManifest.xml

您现在应该能够通过简单地更改 Build 来构建应用程序的免费或付费版本配置。

接下来,为了允许免费版本实际上与付费版本不同,例如限制功能、显示不同的页面等,您需要添加一个条件编译符号,例如 FREE_VERSION 到两个免费构建配置中。

那么您可以简单地使用编译器指令来更改代码,例如:

#if FREE_VERSION
    s = "My App Free";
#else
    s = "My App Paid";
#endif

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
昔日梦未散 2024-11-23 15:27:46

如果您想要免费和付费版本的单独应用程序(大概您正在限制免费应用程序的功能或添加广告),那么我会创建一个单独的项目,然后链接到另一个项目的现有文件(使用“添加为”关联”)。

然后您可以根据需要自定义不同的版本。在做这样的事情时,我喜欢使用部分方法(和类)来扩展和自定义不同的版本。
您可能还想使用应用程序特定的编译器指令来将功能限制为特定版本。

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.

橘虞初梦 2024-11-23 15:27:46

试用 API 旨在处理这样的情况。您可以检查 IsTrial 是否为 true,在这种情况下,您可以将所有功能限制在一个代码库中。我假设您避免了这种情况,以确保您的应用出现在市场的免费部分中。在这种情况下,您必须将其作为新应用程序提交,这意味着新的 GUID。

AFAIK(也许有人有另一种方法),您必须创建一个新项目并运行单独的构建。您可以在大部分情况下包含现有的代码库,但如果不包含试用 API,您最终会得到两个版本。由于这是一个新项目,您可以将磁贴图标更改为您想要的任何内容。

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.

俏︾媚 2024-11-23 15:27:46

Jeff Brand 还准备了一个非常好的 TrialManager 库,它允许您实现不同类型的试验管理。

类似场景:

  • 使用 N 次后过期
  • 使用 T 分钟后过期
  • ...

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文