1
votes

I have an msi installer, made via InstallShield, which moves some files to required location, writes some info to registry and installes VSTO runtime. But I need to launch the .vsto file, that is installed with the application, after the installation is over. Can I do this with custom actions? If that file was an .exe file, that would be rather easy, but how could I launch a .vsto file?
[upd]

Well, may be there is an easier solution: Can I just call the function:
public override void Install(IDictionary stateSaver)
from InstallShield? Something like that: Custom Action->Call a function in a Windows Installer dynamic link library->stored in binary table=>
AssemblyFile = \InclusionListCustomActions.dll MethodSignature = InclusionListCustomActions.TrustInstaller.Install(but what parameter goes here?)

2
why you want to launch .vsto file?Brijesh Mishra
That's the plugin for Microsoft Office Outlook. The previous version of installer was made in Visual Studio, but, for some reason, we need to change tool for creating installers to InstallShield. In VS this operation was made with CustomActionData property, and I don't know, how to do it in InstallShield.Olter
I have written many blog articles on this subject. Google VSTO lessons learned.Christopher Painter

2 Answers

3
votes

You shouldn't launch the VSTO file because this will only install it per-user. What you should do is add it to the AddIns registry key for the office application you need and use the |vstolocal attribute to tell it to not deploy to the click once cache.

0
votes

you can follow steps described in http://msdn.microsoft.com/en-us/library/cc563937%28v=office.12%29.aspx, you can copy same steps in Installshield, After file is copied and registry value set as specified, on starting office app it will automatically pick up vsto file

To add information to inclusion list you will have to write a console application and then call console app from installshield. Below code will help

            string RSA_PublicKey = @"<RSAKeyValue><Modulus></Modulus></RSAKeyValue>";
            //get this key from .vsto file
            try
            {
                SecurityPermission permission =
                    new SecurityPermission(PermissionState.Unrestricted);
                permission.Demand();
            }
            catch (SecurityException)
            {
                Console.WriteLine(
                    "You have insufficient privileges to " +
                    "register a trust relationship. Start Excel " +
                    "and confirm the trust dialog to run the addin.");
                Console.ReadLine();
            }
            Uri deploymentManifestLocation = null;
            var excelPath = YourAPPPath;              
            if (Uri.TryCreate(excelPath,
                UriKind.RelativeOrAbsolute, out deploymentManifestLocation) == false)
            {
                Console.WriteLine(
                    "The location of the deployment manifest is missing or invalid.");
                Console.ReadLine();
            }

            if (!File.Exists(excelPath))
            {
                UserInclusionList.Remove(deploymentManifestLocation);
                Console.WriteLine(deploymentManifestLocation.ToString() + "removed from inclusion list");

            }
            else
            {
                AddInSecurityEntry entry = new AddInSecurityEntry(
                          deploymentManifestLocation, RSA_PublicKey);
                UserInclusionList.Add(entry);
                Console.WriteLine(deploymentManifestLocation.ToString() + "Added to inclusion list");                  
            }