问题
I need to run some VSTOs after they been installed. Everything I tried came out negative.
One example:<Property Id="runcmd">start</Property>
<CustomAction Id="RunOutlookVSTO"
Property="runcmd"
Execute="deferred"
Return="asyncNoWait"
ExeCommand="[SourceDir]Outlook2010AddIn.vsto">
</CustomAction>
<InstallExecuteSequence>
<Custom Action="RunOutlookVSTO"
After="PublishProduct">NOT INSTALLED</Custom>
</InstallExecuteSequence>
Error: No reaction.
Second example: replace start with cmd
Error: No reaction.
Third example: Replace start with msiexec and msiexec /i
Error: msiexec help screen and "did not find any msi to exec"
Fourth example: <Custom action id="RunOutlookVSTO" etc>
Error: Does not understand custom at compile.
EDIT: Seems to be a bit of a confusion, just to be clear - yes I tried the registry key, and it is being ignored by the Office applications (Outlook, Word, Excel).
<RegistryKey Action="none" Root="HKLM" Key="SOFTWARE\Microsoft\Office\14.0\User Settings\">
<RegistryKey Id="CreateVSTOOutlook" Action="createAndRemoveOnUninstall"
Key="OUR.Outlook2010AddIn\Create\Software\Microsoft\Office\Outlook\Addins\OUR.Outlook2010AddIn">
<RegistryValue Id="CmdLineOutlook" Name="CommandLineSafe" Value="1" Type="integer"></RegistryValue>
<RegistryValue Id="descOutlook" Name="Description" Value="Tilføjelsesprogram til Outlook 2010" Type="string"></RegistryValue>
<RegistryValue Id="nameOutlook" Name="FriendlyName" Value="Outlook 2010 AddIn" Type="string"></RegistryValue>
<RegistryValue Id="LoadOutlook" Name="LoadBehavior" Value="3" Type="integer"></RegistryValue>
<RegistryValue Id="manifestOutlook" Name="Manifest" Value="[INSTALLDIR]OUR.Outlook2010AddIn.vsto|vstolocal" Type="string"></RegistryValue>
</RegistryKey>
</RegistryKey>
Any ideas what I could try next?
回答1:
Vsto addins are not standalone programs you can execute. They are dll's that get loaded and then called by the respective office programs through a special bootstrapper.
In your case starting OUTLOOK should load the addin (if it's registered properly). And nothing else will.
-- EDIT --
The .vsto file extension gets associated with the VstoInstaller.exe which is the program you try to run. Note that the vsto file is not a program and as such can't be executed/run. It is a configuration file that is understood by the vstoinstaller (program).
For a default installation VSTOInstaller.exe can be found in
C:\Program Files\Common Files\microsoft shared\VSTO\10.0\VSTOInstaller.exe
it has a /help switch but the install syntax is:
VSTOInstaller.exe /i \servername\foldername\AddIn.vsto
for more info see this msdn link
来源:https://stackoverflow.com/questions/8431898/how-to-execute-vsto-post-install-by-wix