![]() |
Visual Studio Office Tools SE, VSTO, Install By Thomas Tingsted Mathiesen (tma@tma.dk) |
|
| Last changes made: 22 FEB 2007 | ||













| Date | Name | Rate | Message | Homepage |
| 15-09-2011 | Aldo Elam Majiah | 9 |
Deploying vstor.exe (Visual Studio 2005 Tools for Office Second Edition Runtime) using Group Policy. 1. Copy vstor.exe to a share folder. Give the share folder read access to Domain Users 2. Create a GPO and apply it to appropiate Computers Organizational Unit (not Users OU). 3. In the OU, modify startup script (Computer Configuration -- Windows Settings -- Scripts -- Startup. 4. Make your GPO run the script below. Give a .vbs extension to the script (Its a vbscript). You might want to encrypt it into a .vbe file because the script contains a password. this GPO and script have been tested succesfully. ------------------------ Option explicit Dim oShell Dim objFSO, strSourceFile, strTargetFile strSourceFile = \servernameshare_foldervstor.exe strTargetFile = c: set oShell= Wscript.CreateObject(WScript.Shell) Set objFSO = CreateObject(Scripting.FileSystemObject) On Error Resume Next If objFSO.FileExists( strTargetFile) Then Endend Else objFSO.CopyFile strSourceFile, strTargetFile End If oShell.Run RunAs /noprofile /user:your_domainadministrative_account C:vstor.exe /q WScript.Sleep 100 oShell.Sendkeys password_of_the_administrative_account~ Endend: Wscript.Quit --------------------------- Regards, Aldo Elam Majiah | |
| 29-07-2011 | Oliver | 8 | Great description, thanks! | |
| 30-06-2010 | Nathan | 8 | Great, but:
if (!machinePolicyLevel.RootCodeGroup.Children.Contains(codeGroup)) { machinePolicyLevel.RootCodeGroup.AddChild(codeGroup) } for several installations, works more elegantly... (Sorry for my english) | n-soft.pl |
| 28-05-2010 | sopan | 9 | Thanks Dear
This article is very useful | |
| 01-03-2010 | 9 | Great article and thanks a lot. | ||
| 22-01-2010 | 9 | Thanks a lot, it works | ||
| 14-09-2009 | Shreez | 9 | Thanks a ton!!! it helped me a lot. | www.whattoname.com |
| 27-08-2009 | 9 | Great work! Heres the c# version of the code.
public override void Install(IDictionary stateSaver) { base.Install(stateSaver) try { PolicyLevel machinePolicyLevel = null IEnumerator policyHierarchy = SecurityManager.PolicyHierarchy() while (policyHierarchy.MoveNext()) { PolicyLevel level = (PolicyLevel)policyHierarchy.Current if (level.Label == Machine) { machinePolicyLevel = level break } } if (machinePolicyLevel == null) throw new ApplicationException(Could not find Machine Policy level. + Code Access Security is not configured for this application.) PermissionSet permissionSet = new NamedPermissionSet(FullTrust) string assemblyPath = this.Context.Parameters[assemblypath] string installDirectory = assemblyPath.Substring(0, assemblyPath.LastIndexOf(\)) if (!installDirectory.EndsWith(\)) installDirectory = installDirectory + \ installDirectory += installDirectory += * IMembershipCondition membershipCondition = new UrlMembershipCondition(installDirectory) PolicyStatement policyStatement = new PolicyStatement(permissionSet) CodeGroup codeGroup = new UnionCodeGroup(membershipCondition, policyStatement) codeGroup.Description = VSTO Permissions for Objectware AS Plugins codeGroup.Name = Objectware AS machinePolicyLevel.RootCodeGroup.AddChild(codeGroup) SecurityManager.SavePolicy() } catch (Exception ex) { MessageBox.Show(Ex1: + ex.ToString(), Installer error) } } | ||
| 13-07-2009 | 9 | |||
| 20-04-2009 | 8 | Thanks for this sample and it works great. I am trying to add a new project in C# for Ms Excel 2003 with VS.NET 2005. When I deploy it does not work at all - I have no idea why as everything is the same as outlook!
Could anyone advise? Regards, LG | ||
| 26-01-2009 | 9 | |||
| 16-09-2008 | YUDS | 8 | Good Article | |
| 11-07-2008 | 9 | |||
| 01-02-2008 | SAURABH | 4 | BUT IT NOT WORKS WHEN I RUN SETUP ON CLIENT MACHINE | |
| 29-01-2008 | 7 | Understanding what is done is not required to port this VB.NET into C#.NET.
Actually, namespaces, methods naming... are the same in the both language. They just differ from syntax. As argument I do not know VB.NET but I made the translation for about 5 minutes... But as Dsnyder have noticed about the line containing: Dim assemblyPath As String = Me.Context.Parameters(assemblypath) that does not compile. So, some changes have to be done. Actually we can replace the line below by the following lines. Lets see: System.Collections.IEnumerator parameters = Context.Parameters.GetEnumerator() String assemblyPath = null while (parameters.MoveNext()) { System.Collections.DictionaryEntry entry = (System.Collections.DictionaryEntry)parameters.Current if (assemblypath.Equals((String)entry.Key)) assemblyPath = (String)entry.Value } if (assemblyPath == null) { throw new ApplicationException(Could not find assembly path) } It surely can be simplier than that you have seen. But it works fine. Thank you very much for this input :) /Thomas | ||
| 22-01-2008 | Dsnyder | 9 | Srivinas, Im guessing you used a code converter that didnt properly change the brackets. if you change this:
string assemblyPath = this.Context.Parameters(assemblypath) to this: string assemblyPath = this.Context.Parameters[assemblypath] it should compile just fine. | |
| 21-01-2008 | Srinivas | 8 | its a nice article. can u tell me in the installer class iam getting one error that is...[i have developed this in c#]
Dim assemblyPath As String = Me.Context.Parameters(assemblypath) in c# it is.. string assemblyPath = this.Context.Parameters(assemblypath) for this iam getting the error as..... Error 1 System.Configuration.Install.InstallContext.Parameters is a property but is used like a method E:NewaddinNewaddinInstaller1.cs 34 49 Newaddin | srinivas.rejeti@nannacomputers.com |
| 18-01-2008 | MBurger | 9 | Great article, thanks a lot! I notice there is more (needed) code in the installer1.vb found in the zipped file than whats explained here. | |
| 12-12-2007 | Nick Lucas | 9 | Its a bit easier with Office 2007, you dont need to copy the Outlook.dll. If anyone wants the installer code in c# mail me nickl at pinewood dot co dot uk | |
| 23-11-2007 | jainishcs | 9 | it is nice | jainishcs@yahoo.com |
| 19-11-2007 | 9 | Great work, its a slap on MSDN | ||
| 25-10-2007 | Bhavesh Jain | 9 | BEST BEST BEST deployment article. I couldn`t get through this issue since last 4 weeks, this article helped get through issue in just few mins.. Cheers!!! | |
| 26-09-2007 | GL | 9 | Thanks a million for this article...MSDNs walkthroughs on this were horrible. | |
| 19-09-2007 | djm | 9 | thnks great | |
| 10-09-2007 | 9 | |||
| 31-08-2007 | 9 | |||
| 30-07-2007 | 9 | |||
| 27-06-2007 | oh | 9 | Super artikel. Mange tak for hjælpen
| |
| 08-06-2007 | vipul | 9 | Its really gr8 article, thanks lot buddy |