如何测试Windows 8应用程序的更新路径?

时间:2021-04-26 07:27:36

When I develop for Windows Phone, I am able to side load the current version of the app (version on the Windows Store) and then run the app in development in the same emulator. This give me an idea if the app update work.

当我为Windows Phone开发时,我能够加载当前版本的应用程序(Windows应用商店中的版本),然后在同一个模拟器中运行应用程序。这让我知道应用程序更新是否有效。

I am trying to do the same thing with Windows 8 App but it doesn't work. I side load the current version of the app and then run the app in development and I get the following message: "The app ... is already installed on this machine".

我试图用Windows 8 App做同样的事情,但它不起作用。我一边加载应用程序的当前版本,然后在开发中运行应用程序,我收到以下消息:“应用程序...已安装在此计算机上”。

How can I test the update path for my Windows 8 app?

如何测试Windows 8应用程序的更新路径?

Thanks!

谢谢!

1 个解决方案

#1


1  

When you build an app from the Windows Store it gets packed up into a an .appx file, which, you can submit for certification or side load using the PowerShell script.

当您从Windows应用商店构建应用时,它会被打包成一个.appx文件,您可以使用PowerShell脚本提交认证或侧面加载。

When you run it in a development environment (pressing “play” in Visual Studio) it installs an unpackaged version in a different directory. What this means is that you must remove the packaged version before you can install the unpackaged one.

当您在开发环境中运行它(在Visual Studio中按“播放”)时,它会在另一个目录中安装一个未打包的版本。这意味着您必须先删除打包的版本,然后才能安装未打包的版本。

However, you can build a package and side load that one, as long as the version number is larger than the one already installed:

但是,只要版本号大于已安装的版本号,就可以构建一个包和侧面加载:

  • In Visual Studio, right click on your project and select “Store” and then "Create App packages...". When asked if you need to build the package for upload to the Windows Store, select "No".
  • 在Visual Studio中,右键单击您的项目并选择“Store”,然后选择“Create App packages ...”。当系统询问您是否需要构建用于上载到Windows应用商店的软件包时,请选择“否”。
  • Choose an output location and enter a version number higher than the one of the currently installed version
  • 选择输出位置并输入高于当前安装版本的版本号
  • Wait for the project to build.
  • 等待项目构建。
  • Start Windows PowerShell from the start screen, and navigate to the output directory from the above step
  • 从开始屏幕启动Windows PowerShell,然后从上一步导航到输出目录
  • Navigate to the sub directory for the correct build of your app (eg. “MyApp_1.0.1_x64_Debug”)
  • 导航到子目录以正确构建您的应用程序(例如“MyApp_1.0.1_x64_Debug”)
  • Run .\Add-AppDevPackage.ps1 and wait for the app to install.
  • 运行。\ Add-AppDevPackage.ps1并等待应用程序安装。

This will have upgraded your current packaged install to the new version, which will allow you to test that any upgrade code in your app works, you will not, however be able to debug it in Visual Studio.

这会将您当前的打包安装升级到新版本,这将允许您测试应用程序中的任何升级代码是否有效,但您无法在Visual Studio中对其进行调试。

Note, that when your done testing, you should use the remove-appxpackage <Your app ID> (Documentation) PowerShell command to uninstall the side loaded version to prevent you from having issues if you try and install a version from the Windows Store.

请注意,完成测试后,应使用remove-appxpackage <您的应用程序id> (文档)PowerShell命令卸载侧面加载版本,以防止在尝试从Windows应用商店安装版本时出现问题。

Hope that's helpful.

希望这很有帮助。

-Andy.

-Andy。

Update: I forgot to mention, you may have to run Set-ExecutionPolicy RemoteSigned from an admin PowerShell window before you are able to execute .ps1 scripts - http://technet.microsoft.com/en-us/library/hh849812.aspx

更新:我忘了提及,您可能必须从管理PowerShell窗口运行Set-ExecutionPolicy RemoteSigned才能执行.ps1脚本 - http://technet.microsoft.com/en-us/library/hh849812.aspx

#1


1  

When you build an app from the Windows Store it gets packed up into a an .appx file, which, you can submit for certification or side load using the PowerShell script.

当您从Windows应用商店构建应用时,它会被打包成一个.appx文件,您可以使用PowerShell脚本提交认证或侧面加载。

When you run it in a development environment (pressing “play” in Visual Studio) it installs an unpackaged version in a different directory. What this means is that you must remove the packaged version before you can install the unpackaged one.

当您在开发环境中运行它(在Visual Studio中按“播放”)时,它会在另一个目录中安装一个未打包的版本。这意味着您必须先删除打包的版本,然后才能安装未打包的版本。

However, you can build a package and side load that one, as long as the version number is larger than the one already installed:

但是,只要版本号大于已安装的版本号,就可以构建一个包和侧面加载:

  • In Visual Studio, right click on your project and select “Store” and then "Create App packages...". When asked if you need to build the package for upload to the Windows Store, select "No".
  • 在Visual Studio中,右键单击您的项目并选择“Store”,然后选择“Create App packages ...”。当系统询问您是否需要构建用于上载到Windows应用商店的软件包时,请选择“否”。
  • Choose an output location and enter a version number higher than the one of the currently installed version
  • 选择输出位置并输入高于当前安装版本的版本号
  • Wait for the project to build.
  • 等待项目构建。
  • Start Windows PowerShell from the start screen, and navigate to the output directory from the above step
  • 从开始屏幕启动Windows PowerShell,然后从上一步导航到输出目录
  • Navigate to the sub directory for the correct build of your app (eg. “MyApp_1.0.1_x64_Debug”)
  • 导航到子目录以正确构建您的应用程序(例如“MyApp_1.0.1_x64_Debug”)
  • Run .\Add-AppDevPackage.ps1 and wait for the app to install.
  • 运行。\ Add-AppDevPackage.ps1并等待应用程序安装。

This will have upgraded your current packaged install to the new version, which will allow you to test that any upgrade code in your app works, you will not, however be able to debug it in Visual Studio.

这会将您当前的打包安装升级到新版本,这将允许您测试应用程序中的任何升级代码是否有效,但您无法在Visual Studio中对其进行调试。

Note, that when your done testing, you should use the remove-appxpackage <Your app ID> (Documentation) PowerShell command to uninstall the side loaded version to prevent you from having issues if you try and install a version from the Windows Store.

请注意,完成测试后,应使用remove-appxpackage <您的应用程序id> (文档)PowerShell命令卸载侧面加载版本,以防止在尝试从Windows应用商店安装版本时出现问题。

Hope that's helpful.

希望这很有帮助。

-Andy.

-Andy。

Update: I forgot to mention, you may have to run Set-ExecutionPolicy RemoteSigned from an admin PowerShell window before you are able to execute .ps1 scripts - http://technet.microsoft.com/en-us/library/hh849812.aspx

更新:我忘了提及,您可能必须从管理PowerShell窗口运行Set-ExecutionPolicy RemoteSigned才能执行.ps1脚本 - http://technet.microsoft.com/en-us/library/hh849812.aspx