Metro apps 本地安装

1.如何安装Metro app于本地 

Metro app打包以后,在projectname/Packages/appname_configuretion_Test目录下有.bat,.appx和.cer等文件。

在本地以管理员身份运行.bat文件可将Metro app安装到本地,Metro desktop上有新app图标。

 

2. Metro app安装到哪里去了?

分析.bat文件,app安装到C:/Program Files/Applications文件夹下。

 

3. 命令行安装Metro app

使用powershell命令Add-AppXPackage。

------------------------------------- 

 Learning Powershell

First thing you'll want to run in powershell is "get-help appx".  You'll get the list of commands.

Here are some handy questions and answers:

How do I install a package?

You can use any cases that are easy for you to type since PowerShell cmd-lets are case insensitive. Actually, with PowerShell, just typing add-app and hit Tab should autocomplete the right cmd-let!

Add-AppXPackage c:\MyPackage.appx


How can I see all the pacakages installed?

We have a cmd-let for inventory with Get-AppxPackage.
Get-AppxPackage

PowerShell can pipe the results into filters like this for finding certain packages:
Get-AppxPackage | Where-Object {$_.Name -like "*wwa*" }

Get tired of typing? Too hard to see a big text list? Send it to PowerShell Grid-View and you get a UI for inventory with search!
Get-AppxPackage  Out-GridView

With variables, I can even just get a quick count:
$packages = Get-AppxPackage
$packages.Count

How do I remove a package?

Removing an AppX package needs the package moniker. You can use variables again and inventory to help:
$toRemove = Get-AppxPackage | Where-Object {$_.Name -like "*wwa*" }
Remove-AppxPackage $toRemove.PackageMoniker

So Cool, What else can I do with PowerShell?

How about sorting and getting a customized table of inventory with just Package Name and Install location:
Get-AppxPackage  | Sort-Object Name | Format-Table Name,InstallLocation -Auto

WOW, with PowerShell you can even take inventory and generate an HTML file:
Get-AppxPackage | ConvertTo-Html | Set-Content temp.html

Since PowerShell knows how to navigate XML natively, you can even navigate the Package Manifest with PowerShell. Here is getting the App ID from an app you searched for!
$xml = Get-AppxPackage | Where-Object {$_.Name -like "*wwa*" } | Get-AppxPackageManifest
$xml.Package.Applications.Application.Id

How about navigating the event log to debug problems?

One of the most common things that everyone is looking for is event logs when things go wrong. With PowerShell, not only do you get better error messages directly from the AppX deployment engine, you can easily query for the last 10 ETW messages from the deployment engine!
Get-WinEvent -logname Microsoft-Windows-appx* | Select-Object -last 10 | Format-List -Property Message

 

posted @ 2011-11-01 11:06  Carrot  阅读(1581)  评论(0编辑  收藏  举报