I created a test project in VS 2012
file -> new -> project -> Other Languages -> Visual C# -> Office -> 2010
which builds fine. I would like to deploy this on client machines, looking on the MSDN website I have 2 options, clickonce or installshield
https://msdn.microsoft.com/en-us/library/bb386179(v=vs.110).aspx
I can't use clickonce, and I have been asked not to use installshield but NSIS. I have made progress with NSIS but it fails to register the dll. If I try and manually register it using Regsvr32, I will get an error message
"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.
here is how I try and register within the NSIS script, taken from an old forum page which I don't fully 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 doing the following but the add-in still won't show up 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: This actually worked eventually, I had done other things in the wrong order in the NSIS script. I hadn't copied the .dll to the folder I was attempting to register from using Regasm.exe