How to install an Office-Add-In written in Delphi - Advanced Installer Community
Juergen Bauer
Posts: 12
Joined: Wed Feb 24, 2010 9:33 am

How to install an Office-Add-In written in Delphi

Hello,
I have written an Office-Add-In with Delphi and the tool "Add-In Express for Office".
When I install the dll file via RegSvr32 with the command line, I can use the plug-in without problems in Microsoft Outlook.
Now I want to write an installation package to do the installation progress automatically.

I tried different ways - without success:

1.
I tried to use a custom action which calls the RegSvr32.exe from the windows system path. The installation fails and rolls back.

2.
I tried to use "Call Function From Installed Native DLL" and selected the function "DllRegisterServer". The function exists in the dll component - but the installation progress fails with an error message or succedes but does not show my plug-in in Microsoft Office.

I attached my installation package.
Hopefully, you can show me a way to create a suitable installation package.

Thanks!

Bye,
Jürgen
Attachments
Outlook2BUILDUP.aip
(11.13 KiB) Downloaded 239 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to install an Office-Add-In written in Delphi

Hello Jürgen,

If your addin is created with Add-In Express for Office tool, then please just try to follow our "How to install an Office Add-in Express" article steps.

If this is still of no help, then please send us your AIP (project type) so we can investigate its settings.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Juergen Bauer
Posts: 12
Joined: Wed Feb 24, 2010 9:33 am

Re: How to install an Office-Add-In written in Delphi

Hello,
where can I find the file "adxregistrator.exe"?
I have licenced the Add-In professional version.

Bye,
Jürgen
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to install an Office-Add-In written in Delphi

Hello Jürgen,

The "adxregistrator.exe" is a tool installed by the "Add-in Express" framework. However if you didn't use it to install your addin and instead you were able to successfully install manually the addin by using the regsvr32 system tool, then can you please proceed like this:

1. on your build machine create a BAT file (register.bat) with the following content:

Code: Select all

regsvr32.exe Outlook2Buildup.dll /s
2. open your setup project in Advanced Installer and go to "Files and Folders" page
3. add the above "register.bat" file in the same folder as your addin dll
4. go to "Custom Actions" page and add a Launch file" custom action with sequence, scheduled after "Install Execution Stage" -> "Add Resources" action group, configured like this:
  • File to launch: [#register.bat]
    Execution time: deferred
    Execution Options: all options checked
5. rebuild and test again the setup package

If this is still of no help, then please send us by email to support at advancedinstaller dot com a download link for the built setup package.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Juergen Bauer
Posts: 12
Joined: Wed Feb 24, 2010 9:33 am

Re: How to install an Office-Add-In written in Delphi

Hello,

I tried again to modify my installation package to be able to use the approach via "Call Function From Installed Native DLL".
When I take a look at the log file, I see the following message:

MSI (s) (F4:08) [15:42:06:170]: Executing op: CustomActionSchedule(Action=Outlook2Buildup.dll,ActionType=3089,Source=C:\Program Files (x86)\BauerSoftware\OutlookToBuildup Connector\Outlook2Buildup.dll,Target=DllRegisterServer,)
MSI (s) (F4:44) [15:42:06:170]: Invoking remote custom action. DLL: C:\Program Files (x86)\BauerSoftware\OutlookToBuildup Connector\Outlook2Buildup.dll, Entrypoint: DllRegisterServer
MSI (s) (F4:1C) [15:42:06:170]: Generating random cookie.
MSI (s) (F4:1C) [15:42:06:186]: Created Custom Action Server with PID 6916 (0x1B04).
MSI (s) (F4:98) [15:42:06:201]: Running as a service.
MSI (s) (F4:98) [15:42:06:201]: Hello, I'm your 32bit Elevated Non-remapped custom action server.
MSI (s) (F4:08) [15:42:06:717]: Executing op: End(Checksum=0,ProgressTotalHDWord=0,ProgressTotalLDWord=36138504)
Action ended 15:42:06: InstallExecute. Return value 1.
MSI (s) (F4:08) [15:42:06:717]: Doing action: InstallFinalize
Action 15:42:06: InstallFinalize.
Action start 15:42:06: InstallFinalize.

The registration does not seem to work ...
What am I doing wrong?

Bye,
Jürgen
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to install an Office-Add-In written in Delphi

Hello Jürgen,

Thank you for your sent app files. I have further tested your scenario and it seems that in order to successfully register your addin DLL using AI 11.1 you could proceed like this:

1. create a BAT file with the following content:

Code: Select all

regsvr32.exe %1 /s
2. add your BAT and DLL files in "Files and Folders" page of your setup project
3. add a "Launch file" custom action in "Custom Actions" page configured like this:
Capture.JPG
Capture.JPG (170.13 KiB) Viewed 5346 times
I also sent you by email a download link for a modified version of your setup project which successfully register your Office addin dll.

Hope this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Juergen Bauer
Posts: 12
Joined: Wed Feb 24, 2010 9:33 am

Re: How to install an Office-Add-In written in Delphi

Hello, Daniel,

thank you very much for your sample and description.
Now it works as expected - with one small "ugliness":
When I run the installation, a windows is opened and I am asked whether I want to allow to admit changes to my system.

Can I hide this window?

Or is there another way to install my Add-In with a newer version of AI?
I am open for an update :-).

Bye,
Jürgen
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to install an Office-Add-In written in Delphi

Hello Jürgen,

To do so you will have to create an EXE setup package. Just go to "Custom Actions" page and uncheck the "Run as administrator" option on your custom action. Then go to "Install Parameters" page and check the "Run as administrator" option. This way the whole setup package will run elevated from the beginning.

However please note that the "Run as administrator" option from "Install Parameters" page requires an EXE package type to be built and used.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”