安装 PhoneGAP 到 Visual Studio 2010
今天安装PHONEGAP到VISUAL STUDIO 2010
由于开发环境是在Windows Server R2上 另外 Visual Studio 并没有打过SP1, 之前装过 WP SDK BETA版本。
所以有几件事情需要提前做
- 需要删除之前安装的 WP SDK BETA 版本。
- 安装 Visual Studio SP1. http://www.microsoft.com/download/en/details.aspx?id=23691
- 安装 WP SDK 7.1 http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=27570
注意:由于是WINDOWS SERVER 2008 R2 所以需要修改SDK的安装文件, http://bit.ly/GKHErE 可以参照此篇文章中的部分
Extract the contents of the setup package by running vm_web.exe /x and choosing a path to extract to Go to the folder you extracted to in step 2 and open the file baseline.dat in notepad Look for the section named [gencomp7788] Change the value InstallOnLHS from 1 to 0 Change the value InstallOnWin7Server from 1 to 0 Save and close baseline.dat Run setup.exe /web from the folder you extracted to in step 2 |
这样WP SDK 7.1 就可以在 WINDOWS SERVER R2 下跑了.
然后就是下载PHONEGAP 1.5了 http://phonegap.com/start/#wp
下载到Cordova-1.5.0-Starter.zip 这样的PROJECT TEMPLATE后,把此文件加入到这个 C:\Users\[USERNAME]\Documents\Visual Studio 2010\Templates\ProjectTemplates\ 路径的时候,发现这个模板始终不能够在FILE | NEW PROJECT下面显示
查看了MSDN http://msdn.microsoft.com/en-us/library/y3kkate1.aspx 发现可以将Cordova-1.5.0-Starter.zip包拷贝到 C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplates\CSharp\Silverlight for Windows Phone\1033, 然后运行 devenv /installvstemplates.
Figure: Visual Studio Command tool.
Figure: Visual Studio with PhoneGap.
这样PHONEGAP就成功的安装到VISUAL STUDIO上了。