2014-01-08 48 views
2

我正在一個VSIX擴展包的手動vsixmanifest,是這樣的:從VSIX安裝程序包運行shell命令或可執行文件?

<?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> 

有一種方法來告訴VSIX安裝程序會自動運行CMD命令或可執行文件,就像是一種崗位安裝步驟?

例如,我想運行/安裝一個註冊表腳本(.reg文件),它爲我配置了一些默認擴展選項,但我不知道該過程是否可以通過vsixmanifest自動完成啓動控制檯命令或先前編程的EXE過程。

回答

4

一個vsix軟件包不應該依賴於其設置there is a specific API to access the Visual Studio settings系統的註冊表。 A normal vsix package cannot call or start anything after deployment。您可以讓程序包本身在首次啓動時默認設置。

如果您在安裝過程中確實需要更高級的東西,則可以創建一個.msi而不是一個vsix。 You'll need to extract your vsix and include its contents in your Windows Installer package。或者,您可以使用WixToolset創建MSI安裝程序並使用<VsixInstaller> element註冊Visual Studio軟件包,您可以將其他邏輯放入Wix安裝程序項目中。

+0

謝謝,我選擇了其他更簡單的替代方案,一個運行vsix包和regfile的SFX安裝程序。真正學習MSI只是爲了運行一個文件似乎不是一個好主意,再次感謝! – ElektroStudios

+0

這也會做:)。 – jessehouwing