We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Sains
Posts: 6
Joined: Wed Sep 07, 2016 2:54 am

How to register a dll in the APPDIR

Hi AI forums,

I have managed to create a very basic installer for my app which performs the following very basic tasks:

1. Copies some dlls to the APPDIR (ie. as nominated by the user but with suggested default as very standard)
2. Writes a registry key to prevent the macro warning coming up on the MS Access runtime
3. registers the dlls using regsvr32 by running a bat file in a "custom action"

The bat file contains the following:

md "C:\Program Files (x86)\Dubel Systems\Dubel32\"
cd "C:\Program Files (x86)\Dubel Systems\Dubel32\"
regsvr32 /s .\exg2antt.dll
regsvr32 /s .\ExPrint.dll
regsvr32 /s .\ExSchedule.dll

Calling regsvr32 is the only way I know how to register the dlls. I guess I could do without the "md" line, but I need either the "cd" line (or alternatively just using the full path with regsvr32) as the only way I know to reference the directory they are in.

So my problem is this: if the user decides to change the default directory during the installation process, my calls to regsvr32 will fail because they will not have been copied there. Is there a way to reference the path the user ACTUALLY chooses in the bat, or maybe can I register the dlls another way that doesn't rely on this clunky batch file custom action? Thanks for reading!
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to register a dll in the APPDIR

Hi Sains,

The recommended way to register your DLL files is to go to their "Properties" dialog in the "Files and Folders" page and check the "Auto register file (DLL, OCX, etc.) -> Self register native library" option from the "Registration" tab.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Sains
Posts: 6
Joined: Wed Sep 07, 2016 2:54 am

Re: How to register a dll in the APPDIR

That sounds much simpler than what I was doing, I'll give it a try.

Cheers,

Andrew.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to register a dll in the APPDIR

You're welcome Andrew. Glad to help.

Just let me know if you encounter any problem.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Sains
Posts: 6
Joined: Wed Sep 07, 2016 2:54 am

Re: How to register a dll in the APPDIR

that worked like a dream. Thanks!
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to register a dll in the APPDIR

My pleasure Andrew. I'm glad it worked.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”