在本地部署 Windows 应用商店应用的并行版本 [英] Locally deploy parallel versions of a Windows Store App

查看:28
本文介绍了在本地部署 Windows 应用商店应用的并行版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个 Windows 应用商店应用程序,我喜欢在开发下一个应用程序时安装最新的基线.

I am developing a Windows Store App and I like to keep the most recent baseline installed while developing the next.

问题是,每当我在 Visual Studio 2013(使用 F5)中运行当前的开发版本时,它都会卸载最近的基线.

The problem is that whenever I run the current developmental version in Visual Studio 2013 (with F5) it un-installs the recent baseline.

我通过如下手动编辑 Package.appxmanifest 来创建和安装基线:

I create and install a baseline by manually editing the Package.appxmanifest as follows:

  • 编辑身份名称
  • .R 附加到应用名称的每个实例(例如,MyAppMyApp.R)
  • edit the Identity Name
  • Append .R to every instance of the app name (eg. MyApp to MyApp.R)

(完整文件列表如下)

我认为这应该足够了,但是在我徒劳地尝试使其正常工作时,我还在项目属性中将 .R 附加到程序集名称,例如.MyApp.R,并在MyApp_TemporaryKey.pfx

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

然后,当我运行该应用程序 (F5) 时,它会安装为 MyApp.R,并持续存在并可在 Visual Studio 之外使用.

Then, when I run the app (F5) it is installed as MyApp.R, and persists and can be used outside Visual Studio.

问题是,当我撤消这些更改以恢复开发,并再次以 MyApp 运行它时,MyApp.R 被卸载,我只剩下最新版本,即.MyApp.

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.

我知道这是可以实现的,因为我以前做过一次.我没有准确记录我当时做了什么,因为它看起来并不难,但是经过几个小时的尝试后,我再也做不到了.要么我没有正确复制这些步骤,要么自从我上次这样做以来,Windows 8.1 中的某些内容发生了变化.

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.

为什么Windows会认为这两个版本是同一个App?是否有其他身份或密钥我没有改变?

Why does Windows think the two versions are the same App? Is there another identity or key which I haven't changed?

Package.appxmanifest:

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>

推荐答案

清单中的标识是重要的部分(在可视化清单编辑器中,这是包名称").更改标识足以允许安装两个版本.您还可以将标识更改为有意义的内容而不是 GUID.

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.

如您所见,Visual Studio 将卸载它为您暂存的旧版本,但您可以创建一个部署包并自行重新安装.

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.

当您准备好切换到新基线时,请使用 Project.Store.Create App Packages... 菜单创建开发测试包(即不上传到商店).

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.

现在安装您创建的开发包:转到 AppPackages 文件夹并为要重新安装的旧版本运行 Add-AppDevPackage.ps1.

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.

您最终会得到一个旧版本的正常部署(在 Program Files\WindowsApps 中)开发包和一个新版本的暂存(在您的 VS 项目目录中)包.

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).

这篇关于在本地部署 Windows 应用商店应用的并行版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆