This project has moved and is read-only. For the latest updates, please go here.

Deploy NetOffice Word COM Addin

Nov 23, 2015 at 9:13 PM
I read the misc postings etc on deploying a NetOffice Com addin and I am still not clear on it. I decided to write an Inno script to do it since I am familiar with it and it is fairly easy. I haven't tested it yet but for those that have deployed one can you look this over to see if I am on the right track. I commented out the icon stuff. I don't think I'll add a special icon.

[Setup]
AppName=TripNO
AppVerName=v1.0
DefaultDirName={pf}\TripNO
DefaultGroupName=TripNO
UninstallDisplayIcon={app}\TripNO
OutputDir=setup
OutputBaseFilename=TripNO_v1.0_setup

[Code]

[Tasks]
;Name: "desktopicon"; Description: "Create a &desktop TripNO icon"; GroupDescription: "Additional icons:"; Flags: unchecked
;Name: "quicklaunchicon"; Description: "Create a &Quick Launch TripNO icon"; GroupDescription: "Additional icons:"; Flags: unchecked

[Files]
Source: "bin\Debug\NetOffice.dll"; DestDir: "{app}";  
Source: "bin\Debug\NetOffice.xml"; DestDir: "{app}"; 
Source: "bin\Debug\OfficeApi.dll"; DestDir: "{app}"; 
Source: "bin\Debug\OfficeApi.xml"; DestDir: "{app}"; 
Source: "bin\Debug\stdole.dll"; DestDir: "{app}"; 
Source: "bin\Debug\Trip.dll"; DestDir: "{app}"; 
Source: "bin\Debug\Trip.pdb"; DestDir: "{app}"; 
Source: "bin\Debug\Trip.tlb"; DestDir: "{app}"; 
Source: "bin\Debug\VBIDEApi.dll"; DestDir: "{app}"; 
Source: "bin\Debug\VBIDEApi.xml"; DestDir: "{app}"; 
Source: "bin\Debug\WordApi.dll"; DestDir: "{app}"; 
Source: "bin\Debug\WordApi.xml"; DestDir: "{app}";  
;Source: "tripNO.ico"; DestDir: "{app}"; 

[Run]
;Unregister
Filename: """C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe"" ""{app}\Trip.dll"" /tlb:Trip.tlb /codebase /u";  
;Register  
Filename: """C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe"" ""{app}\Trip.dll"" /tlb:Trip.tlb /codebase"; 

[Registry]


[Icons]
;Name: "{group}\TripNO"; Filename: "{pf}\Microsoft Office\OFFICE14\winword.exe"; Check: FileExists(ExpandConstant('{pf}\Microsoft Office\OFFICE14\winword.exe')); IconFilename: "{app}\tripNO.ico"
;Name: "{commondesktop}\TripNO"; Filename: "{pf}\Microsoft Office\OFFICE14\winword.exe"; Check: FileExists(ExpandConstant('{pf}\Microsoft Office\OFFICE14\winword.exe')); IconFilename: "{app}\tripNO.ico"; Tasks: desktopicon
;Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\TripNO";  Filename: "{pf}\Microsoft Office\OFFICE14\winword.exe"; Check: FileExists(ExpandConstant('{pf}\Microsoft Office\OFFICE14\winword.exe')); IconFilename: "{app}\tripNO.ico"; Tasks: quicklaunchicon

Nov 28, 2015 at 6:51 AM
I dont have any experience with InnoSetup.
The most important thing is the [Run] register/unregister section. (and you dont need the regasm/codebase argument in NetOffice)

You use an hardcoded path to regasm.exe and this may cause issues. In .MSI deployment projects you can use an option "Register:vsdprCOMRelativePath" and the windows installer service want register the addin for you - no need to call RegAsm directly. I suggest you to find out may InnoSetup has a similar feature here. (i'm 99% sure there have for umanaged dll's but not sure for managed/.net dll's)