I am developing a Windows Store App and I like to keep the most recent baseline installed while developing the next.
The problem is that whenever I run the current developmental version in Visual Studio 2013 (with F5) it un-installs the recent baseline.
I create and install a baseline by manually editing the Package.appxmanifest
as follows:
- edit the Identity Name
- Append
.R
to every instance of the app name (eg.MyApp
toMyApp.R
)
(full file listing below)
I think that should be enough, but in my vain attempts to get this working I have also, in the project properties, append .R
to the Assembly name, eg. MyApp.R
, and changed one number in the MyApp_TemporaryKey.pfx
Then, when I run the app (F5) it is installed as MyApp.R
, and persists and can be used outside Visual Studio.
The problem is that when I undo these changes to resume development, and run it again as MyApp
then MyApp.R
is uninstalled, and I am left with only the latest version, ie. MyApp
.
I know that this is achievable because I have done it once before. I didn't record exactly what I did that time, because it didn't seem too hard, but after hours of trying I can't do it again. Either I haven't reproduced the steps correctly, or something has changed in Windows 8.1 since I last did it.
Why does Windows think the two versions are the same App? Is there another identity or key which I haven't changed?
Package.appxmanifest:
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest">
<!--<Identity Name="8086b500-65af-4dd4-a67b-923c43472921" Publisher="CN=joedev_000" Version="1.0.0.0" />-->
<Identity Name="11111111-65af-4dd4-a67b-923c43472930" Publisher="CN=joedev_000" Version="1.0.0.0" />
<Properties>
<DisplayName>MyApp.R</DisplayName>
<PublisherDisplayName>joedev_000</PublisherDisplayName>
<Logo>Assets\StoreLogo.50x50.png</Logo>
</Properties>
<Prerequisites>
<OSMinVersion>6.3.0</OSMinVersion>
<OSMaxVersionTested>6.3.0</OSMaxVersionTested>
</Prerequisites>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="MyApp.R.App">
<m2:VisualElements DisplayName="MyApp.R" Square150x150Logo="Assets\SquareLogo.150x150.png" Square30x30Logo="SquareLogo.30x30.png" Description="MyApp.R" ForegroundText="light" BackgroundColor="#464646">
<m2:DefaultTile Square70x70Logo="SquareLogo.70x70.png" Square310x310Logo="SquareLogo.310x310.png" Wide310x150Logo="WideLogo.310x150.png" ShortName="MyApp.R" DefaultSize="square150x150Logo">
<m2:ShowNameOnTiles>
<m2:ShowOn Tile="square150x150Logo" />
</m2:ShowNameOnTiles>
</m2:DefaultTile>
<m2:SplashScreen Image="Assets\SplashScreen.620x300.png" />
</m2:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>
The Identify in the Manifest is the important part (in the visual manifest editor this is the "Package Name"). Changing the Identity is sufficient to allow both versions to be installed. You can also change the Identity to something meaningful rather than a GUID.
As you note, Visual Studio will uninstall the old version it has staged for you, but you can create a deployment package and install it again yourself.
When you are ready to switch to a new baseline use the Project.Store.Create App Packages... menu to create a development test package (i.e. not to upload to the store).
Update your manifest to use the new Identity. Changing the display names is not technically necessary but will make things less confusing.
Building this will install the new version and remove the staged version.
Now install the development package you created: go to AppPackages folder and run the Add-AppDevPackage.ps1 for the older version you want to reinstall.
You will end up with a normally deployed (in Program Files\WindowsApps) developer package of the old version and a staged (in your VS project directory) package of the new version.
(Alternatively, you can shuffle the versions to rename the old version to indicate it's old, create an app package for the renamed version, re-rename the Identity back to the original, and then install the dev-package for the old renamed version).
Try this if it works... Worked for me
Run the baseline application
Create a new working folder (or branch if you are using a code repository like TFS)
Eg : VS 2013 -> Projects -> App 1 then create VS 2013 -> Projects -> App 1-Copy
something which will be unique like changing the last couple of digits (to make a distinction between both the apps you can change the display name under Application tab and package display name under Packaging Tab)
and run the new application
this will list both your baseline and your development version
Hope this helps