简体   繁体   English

从VSIX安装程序包运行shell命令或可执行文件?

[英]Run a shell command or executable file from a VSIX installer package?

I'm working manually the vsixmanifest of a VSIX extension package, is this: 我正在手动工作VSIX扩展包的vsixmanifest,是这样的:

<?xml version="1.0" encoding="utf-8"?>
<Vsix Version="1.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010">
  <Identifier Id="c669b00e-3746-47bd-bfe7-e6f9d64458ff">
    <Name>RapidDesign</Name>
    <Author>ZUI INFRA sp z o. o.</Author>
    <Version>2.0.1</Version>
    <Description>RapidDesign allows you to use various VisualStudio designers faster.</Description>
    <Locale>1033</Locale>
    <MoreInfoUrl>http://www.rapiddesignaddin.com</MoreInfoUrl>
    <License>EULA.txt</License>
    <Icon>Speedometer.png</Icon>
    <PreviewImage>RapidDesignPreview.png</PreviewImage>
    <InstalledByMsi>false</InstalledByMsi>
    <SupportedProducts>
      <VisualStudio Version="12.0">
        <Edition>Ultimate</Edition>
      </VisualStudio>
    </SupportedProducts>
    <SupportedFrameworkRuntimeEdition MinVersion="4.0" MaxVersion="4.0" />
  </Identifier>
  <References>
    <Reference Id="Microsoft.VisualStudio.MPF" MinVersion="10.0">
      <Name>Visual Studio MPF</Name>
    </Reference>
  </References>
  <Content>
    <VsPackage>RapidDesign.pkgdef</VsPackage>
  </Content>
</Vsix>

There is a way to tell the VSIX installer to run automatically a CMD command or an executable file, like a kind of post-installation step? 有一种方法可以告诉VSIX安装程序自动运行CMD命令或可执行文件,就像一种安装后步骤?

For example I would like to run/install a registry script (.reg file) that configures some default extension options for me, but I don't know if that process can be done automated from the vsixmanifest launching a console command or an EXE process previously programmed. 例如,我想运行/安装一个注册表脚本(.reg文件),为我配置一些默认的扩展选项,但我不知道是否可以从vsixmanifest启动控制台命令或EXE进程自动完成该过程以前编程过。

A vsix package shouldn't rely on the registry for its settings, there is a specific API to access the Visual Studio settings systems. vsix包不应该依赖注册表来设置, 有一个特定的API来访问Visual Studio设置系统。 A normal vsix package cannot call or start anything after deployment . 正常的vsix软件包在部署后无法调用或启动任何内容 You can let the package itself setup defaults the first time it is started. 您可以在第一次启动时让包本身设置为默认值。

If you really need more advanced things during your setup, you can create a .msi instead of a vsix. 如果您在设置过程中确实需要更高级的东西,则可以创建.msi而不是vsix。 You'll need to extract your vsix and include its contents in your Windows Installer package . 您需要提取您的vsix并将其内容包含在Windows Installer程序包中 Or you can use WixToolset to create a MSI installer and use the <VsixInstaller> element to register the Visual Studio Package, you can put the other logic in the Wix installer project. 或者,您可以使用WixToolset创建MSI安装程序并使用<VsixInstaller>元素注册Visual Studio包,您可以将其他逻辑放在Wix安装程序项目中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM