windows - 如何使用 Visual Studio 2010 安装 TypeScript

标签 windows visual-studio-2010 installation typescript

这是一个受欢迎的问题,我将提供答案。

最佳答案

typescript 版本 0.9.1.1

Typescript 0.9.5+ 依赖于 Microsoft.VisualStudio.Shell.11.0.dll。因此,这些说明将不再更新。

以下内容用于教育目的。请遵守所有许可和重新分发要求。对于以前版本的 TypeScript,请参阅此答案的编辑历史记录。

  • 关闭 Visual Studio
  • 安装 Wix Toolset
  • 下载TypeScript for Visual Studio 2012版本 0.9.1.1 并将安装程序可执行文件放在其自己的临时目录中。
  • 在临时目录中打开命令窗口。
  • 执行命令 "%wix%\bin\dark.exe" -x .\TypeScriptSetup TypeScriptSetup.0.9.1.1.exe
  • 转到目录 .\TypeScriptSetup\AttachedContainer\packages\TypeScript_CORE
  • 执行以下命令
    IF NOT DEFINED ProgramFiles(x86) SET ProgramFiles(x86)=%ProgramFiles%
    SET VSDir=%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\IDE
    SET Devenv=%VSDir%\devenv.exe
    

  • 对于 Windows 7 用户

    执行命令:
    TypeScript_CORE.msi /l* log.txt VS11_EXTENSIONS_DIR="%VSDir%\Extensions\Microsoft" VS11_NEWSCRIPTITEMS_DIR="%VSDir%\NewFileItems" VS11DEVENV="%Devenv%" VS11_TARGETSINSTALLFOLDER="%ProgramFiles(x86)%\MSBuild\Microsoft\VisualStudio\v10.0\TypeScript"
    对于 Windows Vista 用户

    您将需要使用 Wix 构建一个新的安装程序
  • 执行命令 "%wix%\bin\dark.exe" -x .\TypeScript_CORE TypeScript_Core.msi
  • 可选择将 TypeScript_CORE.wxs 复制到 TypeScript_CORE.wxs.bak(建议)
  • 编辑 TypeScript_CORE.wxs 替换如下所示的行。为避免可能的版权问题以及由于 StackOverflow 的大小限制,尚未发布完整的更新文件。我能做的最好的事情就是发布差异报告。第一列中的数字是原始文件的行号。第二列中的数字是已编辑文件中的行号。由于删除了行,编辑后的文件中的行号会更低。
  • ------------------------------------------------------------------------
    3           <Product Id="{5A908D89-0620-4CC0-A8B8-2CB4A7B0772C}" Codepage="1252" Language="1033" Manufacturer="Microsoft Corporation" Name="TypeScript for Microsoft® Visual Studio® 2012" UpgradeCode="{F15B62A0-4478-4924-876A-867617EC4B8C}" Version="0.9.1.1">
    4               <Package Comments="This installer database contains the logic and data required to install TypeScript for Microsoft® Visual Studio® 2012." Compressed="yes" Description="TypeScript for Microsoft® Visual Studio® 2012" InstallerVersion="500" Languages="1033" Manufacturer="Microsoft Corporation" Platform="x86" />
        3       <Product Id="{5A908D89-0620-4CC0-A8B8-2CB4A7B0772C}" Codepage="1252" Language="1033" Manufacturer="Microsoft Corporation" Name="TypeScript for Microsoft® Visual Studio® 2010" UpgradeCode="{F15B62A0-4478-4924-876A-867617EC4B8C}" Version="0.9.1.1">
        4           <Package Comments="This installer database contains the logic and data required to install TypeScript for Microsoft® Visual Studio® 2010." Compressed="yes" Description="TypeScript for Microsoft® Visual Studio® 2010" InstallerVersion="405" Languages="1033" Manufacturer="Microsoft Corporation" Platform="x86" />
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    15(delete)              <CustomAction Id="VS11_CAUpdateConfig" Property="VS11DEVENV" ExeCommand="/updateConfiguration" Return="ignore" Execute="deferred" Impersonate="no" />
    16(delete)              <CustomAction Id="VWD11_CAUpdateConfig" Property="VWD11EXPRESS" ExeCommand="/updateConfiguration" Return="ignore" Execute="deferred" Impersonate="no" />
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    222                                 <Directory Id="MSBuild_Microsoft_VisualStudio_11" Name="v11.0">
        220                             <Directory Id="MSBuild_Microsoft_VisualStudio_11" Name="v10.0">
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    293             <Feature Id="TypeScriptInstallation" Level="1" Title="TypeScript for Microsoft&® Visual Studio® 2012 Setup">
        291         <Feature Id="TypeScriptInstallation" Level="1" Title="TypeScript for Microsoft&® Visual Studio® 2010 Setup">
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    427(delete)             <Property Id="WixPdbPath" Value="D:\nightly\release-0.9.1.1\srcSetup\wix\outs\x86ret\enu\cooked\TypeScript_CORE_net.wixpdb" />
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    663                 <ProgressText Action="CAIsVSRunning">Checking if Microsoft® Visual Studio® 2012 is running</ProgressText>
        660             <ProgressText Action="CAIsVSRunning">Checking if Microsoft® Visual Studio® 2010 is running</ProgressText>
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    712                     <Control Id="VSRunningStatus" Type="Text" X="25" Y="110" Width="320" Height="110" Text="Microsoft® Visual Studio® 2012 is running, It is recommended that you close it before proceeding [ProductName] Setup." TabSkip="yes" />
        709                 <Control Id="VSRunningStatus" Type="Text" X="25" Y="110" Width="320" Height="110" Text="Microsoft® Visual Studio® 2010 is running, It is recommended that you close it before proceeding [ProductName] Setup." TabSkip="yes" />
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    739(delete)                     <Control Id="LaunchScreenAgreeLine" Type="Hyperlink" X="25" Y="138" Width="320" Height="14" Text="You must agree to the <a href="[EulaURLName]">License Terms</a> before you can install TypeScript" TabSkip="yes">
    740(delete)                         <Condition Action="hide">Installed</Condition>
    741(delete)                     </Control>
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    799                 <Custom Action="WindowsFolder_x86_VC.F9D0B380_EB85_31D4_96AC_C6CB40086A55" Sequence="1" />
        793             <Custom Action="WindowsFolder_x86_VC.F9D0B380_EB85_31D4_96AC_C6CB40086A55" Sequence="2" />
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    803(delete)                 <Custom Action="VS11_CAUpdateConfig" Sequence="6598">VS11DEVENV</Custom>
    804(delete)                 <Custom Action="VWD11_CAUpdateConfig" Sequence="6599">VWD11EXPRESS</Custom>
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    830                 <InstallFinalize Sequence="6600" />
        822             <InstallFinalize Sequence="6500" />
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    834                 <Custom Action="SystemFolder_x86_VC.F9D0B380_EB85_31D4_96AC_C6CB40086A55" Sequence="1" />
        826             <Custom Action="SystemFolder_x86_VC.F9D0B380_EB85_31D4_96AC_C6CB40086A55" Sequence="2" />
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    860                 <Custom Action="SystemFolder_x86_VC.F9D0B380_EB85_31D4_96AC_C6CB40086A55" Sequence="3" />
        852             <Custom Action="SystemFolder_x86_VC.F9D0B380_EB85_31D4_96AC_C6CB40086A55" Sequence="4" />
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    874                 <Custom Action="WindowsFolder_x86_VC.F9D0B380_EB85_31D4_96AC_C6CB40086A55" Sequence="3" />
        866             <Custom Action="WindowsFolder_x86_VC.F9D0B380_EB85_31D4_96AC_C6CB40086A55" Sequence="4" />
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    889                 <Custom Action="WindowsFolder_x86_VC.F9D0B380_EB85_31D4_96AC_C6CB40086A55" Sequence="3" />
        881             <Custom Action="WindowsFolder_x86_VC.F9D0B380_EB85_31D4_96AC_C6CB40086A55" Sequence="4" />
    ------------------------------------------------------------------------
    
    1. Execute the command "%wix%\bin\candle.exe" TypeScript_CORE.wxs
    2. Execute the command "%wix%\bin\light.exe" -o TypescriptVista TypeScript_CORE.wixobj
    3. Execute the command TypeScriptVista.msi /l* log.txt VS11_EXTENSIONS_DIR="%VSDir%\Extensions\Microsoft" VS11_NEWSCRIPTITEMS_DIR="%VSDir%\NewFileItems" VS11DEVENV="%Devenv%"

    Config File

    Existing projects will need to have the following elements added to the bottom of the project file. Note the elements that have been added prior to the BeforeBuild element.

      <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
        <TypeScriptTarget>ES3</TypeScriptTarget>
        <TypeScriptIncludeComments>true</TypeScriptIncludeComments>
        <TypeScriptSourceMap>true</TypeScriptSourceMap>
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)' == 'Release'">
        <TypeScriptTarget>ES3</TypeScriptTarget>
        <TypeScriptIncludeComments>false</TypeScriptIncludeComments>
        <TypeScriptSourceMap>false</TypeScriptSourceMap>
      </PropertyGroup>
      <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" />
      <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
         Other similar extension points exist, see Microsoft.Common.targets.
      <Target Name="BeforeBuild">  
      </Target>
      <Target Name="AfterBuild">
      </Target>-->
    

    杂项

    在 TypeScript 不再出现在“程序和功能”列表中之前,可能需要进行两次卸载。第一次卸载后,按F5刷新应用程序列表。卸载后某些文件可能仍然存在。

    TypeScript_CORE.msi 中还有用于调试器路径的其他自定义属性。在这一点上,我假设 VS 2010 与脚本调试回不同的源文件不兼容。但是,其他人可能希望尝试使其正常工作。其他自定义属性名称为:VS11_DEBUGGER_DIR、VS11_DEBUGGER_X64_DIR 和 VS11_REMOTEDEBUGGER_DIR

    还有一些额外的自定义属性可以使用visual web developer或visual web developer express中的一个或两个来启用安装。我没有能力测试这些产品的安装。 TypeScript_CORE.msi 文件中与此安装相关的自定义属性是:VWD11_EXTENSIONS_DIR、VWDExpress11 和 VWD11_NEWSCRIPTITEMS_DIR

    功能
  • 新的项目类型和项目类型可用。
  • 工具\选项菜单下的 TextEditor\TypeScript 部分。
  • .ts 文件的智能感知编辑。
  • .js 文件是在构建或保存时构建的(当在文本编辑器选项中设置了保存时构建)。
  • .js 文件在解决方案资源管理器中显示为 .ts 文件的子文件,但保存在与 .ts 文件相同的路径中。 (v 0.9.1.1 默认不包含项目中的 .js 文件)
  • 发布时不包含 .ts 文件,只包含 .js 文件。
  • .ts 文件有自己的图标并与 Visual Studio 相关联。

  • 修订记录
  • TypeScript 0.9.1.1 版更新
  • 更新了 TypeScript 版本 0.8.3.1
  • 修复了丢失的指令
    复制 0.8.3 的 MSBUILD 目录

  • 截图

    Project Template Screenshot
    Editor Screenshot
    Solution Explorer Screenshot
    TypeScript Options Screenshot
    FileIcon Screenshot

    关于windows - 如何使用 Visual Studio 2010 安装 TypeScript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14510511/

    相关文章:

    node.js - npmzip 有替代方案吗?

    c++ - 在 Windows R 中使用 openmp,rtools 是否支持 openmp?

    c++ - 所有者使用 Windows API 绘制按钮的文本

    c++ - 将 Java 代码助手的便利性从 Eclipse 带到 Visual Studio 2010 以用于原生 C++ 项目

    c# - 用于 VS 查找和替换的正则表达式 - 清空其他 block

    c# - 如何知道在构建中使用哪个 cpu(x86 x64 或 AnyCpu)?

    java - 使用 android studio 找不到 jvm,已设置 JAVA_HOME

    php - 为我的整个网站创建一个数据库层类,需要一些关于 PHP 的建议吗?

    windows - GS 寄存器在 Windows 上有什么用?

    c++ - 如何找到每个线程正在运行的处理器?