首页 > 代码库 > 转UWP
转UWP
Win10是一个内核,一个商店,一个平台(UWP)。
一、silverlight转UWP
安装mobilize,然后在vs中打开wp for silverlight项目,右键转换即可。
二、 win32转UWP
可以抱exe直接转UWP
可以在exe中使用UWP API
可以在把exe和BackgroudTask转成UWP
需要有一个应用清单AppxManifest.xml,注意下面结点中的<PublisherDisplayName>CN=Demo01</PublisherDisplayName>一定要与应用名称相同
<?xml version="1.0" encoding="utf-8"?> <Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"> <Identity Name="Demo01" ProcessorArchitecture="x64" Publisher="CN=Demo01" Version="0.0.0.1" /> <Properties> <DisplayName>Demo01</DisplayName> <PublisherDisplayName>CN=Demo01</PublisherDisplayName> <Logo>Assets\SampleAppx.150x150.png</Logo> </Properties> <Resources> <Resource Language="en-us" /> </Resources> <Dependencies> <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14316.0" MaxVersionTested="10.0.14316.0" /> </Dependencies> <Capabilities> <rescap:Capability Name="runFullTrust" /> </Capabilities> <Applications> <Application Id="Demo01" Executable="Demo01.exe" EntryPoint="Windows.FullTrustApplication"> <uap:VisualElements DisplayName="Demo01" Description="Demo01" BackgroundColor="#777777" Square150x150Logo="Assets\SampleAppx.150x150.png" Square44x44Logo="Assets\SampleAppx.44x44.png"/> </Application> </Applications> </Package>
需要有一个Mapping文件
[Files]
"C:\Users\gsw\Desktop\Ignite\MyDemo\MyDemo0\Demo01Package\Demo01.exe" "Demo01.exe"
"C:\Users\gsw\Desktop\Ignite\MyDemo\MyDemo0\Demo01Package\AppxManifest.xml" "AppxManifest.xml"
"C:\Users\gsw\Desktop\Ignite\MyDemo\MyDemo0\Demo01Package\Assets\SampleAppx.44x44.png" "Assets\SampleAppx.44x44.png"
"C:\Users\gsw\Desktop\Ignite\MyDemo\MyDemo0\Demo01Package\Assets\SampleAppx.150x150.png" "Assets\SampleAppx.150x150.png"
手动转换过程
//Cross Tools Command Prompt
第一步
MakeCert.exe -r -h 0 -n "CN=Demo01" -eku 1.3.6.1.5.5.7.3.3 -pe -sv demo01.pvk demo01.cer
//Cross Tools Command Prompt
第二步
pvk2pfx.exe -pvk demo01.pvk -spc demo01.cer -pfx demo01.pfx
//Cross Tools Command Prompt
老三步
Certutil -AddStore Root demo01.cer
//Cross Tools Command Prompt
第四步
Makeappx Pack /f mapping.mapping /P demo01.appx
//Cross Tools Command Prompt
第五步
signtool.exe sign -f demo01.pfx -fd SHA256 -v demo01.appx
三、 Web转UWP
源码见附件
本文出自 “桂素伟” 博客,请务必保留此出处http://axzxs.blog.51cto.com/730810/1879394
转UWP