Ric*_*tte 44

TypeScript版本0.9.1.1

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

以下内容仅供教育之用.请遵守所有许可和再分发要求.对于TypeScript的早期版本,请参阅此答案的编辑历史记录.

  1. 关闭Visual Studio
  2. 输入Wix工具集
  3. 下载VisualScript 2012版本0.9.1.1的TypeScript,并将安装程序可执行文件放在其自己的临时目录中.
  4. 在临时目录中打开命令窗口.
  5. 执行命令 "%wix%\bin\dark.exe" -x .\TypeScriptSetup TypeScriptSetup.0.9.1.1.exe
  6. 转到目录.\ TypeScriptSetup\AttachedContainer\packages\TypeScript_CORE
  7. 执行以下命令

    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
    
    Run Code Online (Sandbox Code Playgroud)

对于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构建新的安装程序

  1. 执行命令 "%wix%\bin\dark.exe" -x .\TypeScript_CORE TypeScript_Core.msi
  2. (可选)将TypeScript_CORE.wxs复制到TypeScript_CORE.wxs.bak(建议)
  3. 编辑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. 执行命令 "%wix%\bin\candle.exe" TypeScript_CORE.wxs
  2. 执行命令 "%wix%\bin\light.exe" -o TypescriptVista TypeScript_CORE.wixobj
  3. 执行命令 TypeScriptVista.msi /l* log.txt VS11_EXTENSIONS_DIR="%VSDir%\Extensions\Microsoft" VS11_NEWSCRIPTITEMS_DIR="%VSDir%\NewFileItems" VS11DEVENV="%Devenv%"

配置文件

现有项目需要将以下元素添加到项目文件的底部.请注意在BeforeBuild元素之前添加的元素.

  <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>-->
Run Code Online (Sandbox Code Playgroud)

杂项

在" 程序和功能"列表中不再显示TypeScript之前,可能需要执行两次卸载.首次卸载后,按F5刷新应用程序列表.卸载后,某些文件可能仍然存在.

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

还有其他自定义属性可以使用可视Web开发人员或可视Web开发人员表达中的一个或两个来安装.我无法使用这些产品测试安装.与此安装相关的TypeScript_CORE.msi文件中的自定义属性为:VWD11_EXTENSIONS_DIR,VWDExpress11和VWD11_NEWSCRIPTITEMS_DIR

功能

  • 新项目类型和项目类型可用.
  • Tools\Options菜单下的TextEditor\TypeScript部分.
  • Intellisense编辑.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进行了更新
  • 修复了丢失指令以复制MSBUILD目录为0.8.3

截图

项目模板截图 编辑截图 Solution Explorer截图 TypeScript选项截图 FileIcon截图

  • 请注意,TypeScript已更新为0.9.0.1.Visual C++可再发行组件已更新为Update 3.我已确认您的说明仍然有效.你能否更新链接说明?我试过,但我的编辑被拒绝了. (2认同)
  • 关于MSBuild目标不在"v10.0"文件夹中的上述问题实际上也会影响上述0.9.1.1的说明.我之前没有意识到这一点,因为我在安装0.9.1.1之前安装了以前版本的TypeScript.我已经更新了我的答案来定义`VS11_TARGETSINSTALLFOLDER`变量来解决这个问题.(这是特定于Windows 7的.)我可能会看到我是否可以编辑你的修复它. (2认同)