Project Setup for PAID and FREE App? can we copy and rename a Project

Like many App publishers I plan to release both PAID and FREE versions of my Apps.

The changes between the versions are quite small so I’m keeping ONE main.lua with a few
if appVersion == “FREE” then tests to remove functionality that hasn’t been purchased yet.

I assume many others here are doing the same. However I need to have 2 versions of the 7 files that are required for the Icons… what is the best way to handle this in CPM? The options I can think are below.

a) Have ONE generic project Folder and manually swap the correct Icons when making each build. Not great and prone to manual errors and a forgetful mind :slight_smile:

b) Use TWO project folders that point to the 99% of files that are the same but insert the correct Icon files into each i.e. PAID and FREE.

c) Any other solution?

I’d like to try option B) but whilst my sources files are in one directory, the art assets (>80) come from a more complex directory tree, due to updates and versions of the art assets.

How do I copy a Project so I can rename it? I don’t really want to add the files manually to the new Projects as they are coming from several directories, and I’m bound to mess something up!

Thanks for reading this far, and hopefully someone can offer advice [import]uid: 3093 topic_id: 23245 reply_id: 323245[/import]

I do the two folder method.
[import]uid: 19626 topic_id: 23245 reply_id: 93051[/import]

CPM has the ability to do “Dynamic Assets” – you could have one folder full of assets for the free version called Images Free and one full of assets for the paid version called Images Paid.

Then set the alias for each one to just plain old images (right click each asset to change the alias).

Now, when you want to build the free version, make sure the dot in front of that folder is Green and the dot in front of the other is Red.

In your source code you will always just refer to the alias’d named, for example:

horse = display.newImage("images/horsey.png")

By flipping those dots from red to green you can choose which one gets used by the Corona Simulator when you hit Launch or Publish.

I hope that helps.

Jay

PS - Right now there’s no way to copy a project.
[import]uid: 9440 topic_id: 23245 reply_id: 93134[/import]

Jay and Rob thanks for prompt feedback.

Alias directories is something I need to look into. Due to the time difference in the UK I just went ahead and used the 2 folder option, it was my Bad the art assets were all over the place but I got there in the end. No worries about project copy.

Anyway it’s a great function of CPM to allow this kind of build switching. Another great reason to use CPM. [import]uid: 3093 topic_id: 23245 reply_id: 93250[/import]