I created a test project in VS 2012
file β new β project β Other languages βββ Visual C # β Office β 2010
which builds great. I would like to deploy this on client machines by looking at the MSDN website. I have 2 options, clickonce or installshield.
https://msdn.microsoft.com/en-us/library/bb386179(v=vs.110).aspx
I cannot use clickonce, and I was asked not to use installshield, but NSIS. I made progress in NSIS but could not register the dll. If I try to manually register it using Regsvr32, I get an error
"The module" [filepath] TestAddin.dll "was loaded, but the entry point DLLRegisterServer was not found. Make sure that" [filepath] TestAddin.dll "is a valid DLL or OCX file, and then try again.
This is how I try to register in an NSIS script taken from the old forum page, which I donβt quite understand.
Exec 'regsvr32.exe /s "$INSTDIR\MyExcelAddin.dll"' WriteRegStr HKLM "Software\Microsoft\Office\Excel\Addins\MyExcelAddin.Connect" "FriendlyName" "MyExcelAddin" WriteRegStr HKLM "Software\Microsoft\Office\Excel\Addins\MyExcelAddin.Connect" "Description" "MyExcelAddin" WriteRegDWORD HKLM "Software\Microsoft\Office\Excel\Addins\MyExcelAddin.Connect" "LoadBehavior" "00000003" WriteRegDWORD HKLM "Software\Microsoft\Office\Excel\Addins\MyExcelAddin.Connect" "CommandLineSafe" "00000000"
Update: I can now create registry entries by doing the following, but the add-in will not yet appear in excel
SetRegView 64 Exec '"%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" "$INSTDIR\MyExcelAddin.dll"' WriteRegStr HKLM "Software\Microsoft\Office\Excel\Addins\MyExcelAddin" "FriendlyName" "MyExcelAddin" WriteRegStr HKLM "Software\Microsoft\Office\Excel\Addins\MyExcelAddin" "Description" "MyExcelAddin" WriteRegStr HKLM "Software\Microsoft\Office\Excel\Addins\MyExcelAddin" "Manifest" "Manifest file:///$INSTDIR\MyExcelAddin.vsto|vstolocal" WriteRegDWORD HKLM "Software\Microsoft\Office\Excel\Addins\MyExcelAddin" "LoadBehavior" "00000003" WriteRegDWORD HKLM "Software\Microsoft\Office\Excel\Addins\MyExcelAddin" "CommandLineSafe" "00000000"
update 2: It really worked, I did other things in the wrong order in the NSIS script. I did not copy the .dll to the folder that I was trying to register using Regasm.exe