pwr
Posts: 10
Joined: Mon Jul 25, 2011 9:49 am

custom action with DLL returns 1723

Hi!
I need to copy some drivers and install them during my installation. Since I can't be sure that Visual Basic is installed on the computer running the installer, I have decided to do this with help from a custom DLL that copies and installs the drivers. The documentation does not really explain how the function parameters should be defined.

When I run my installation I end up with the error code 1723. I can't find any explanation of what this error code actually mean. Is there a list of error codes with explanation so I can debug this?

This is one of my functions:

extern "C" __declspec( dllexport ) int __cdecl CopyAddOns( wchar_t* pSourceFolder, wchar_t* pTargetFolder )

As you can see, is the folder paths given as char pointers. But when I try to set the argument values in Advanced installer I only have the option to send arguments as references with type String. Does this mean that the function needs to use std::string? Could that be causing the 1723?
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: custom action with DLL returns 1723

Hi,

Have you tried creating a DLL after the following sample? This allows you pass the
parameters using public properties and can be called very easily, just adding it as a new attached custom action.

Our article also contains a sample project which you can use as a starting point for your custom action.

Regads,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
pwr
Posts: 10
Joined: Mon Jul 25, 2011 9:49 am

Re: custom action with DLL returns 1723

Thanks for a quick reply. The sample does not really explain how to use DLLs as custom actions and when one need to pass c string parameters containing paths to folders. From what I understand, is the DLL defined in the "Licensing" settings which does not seem to have the same properties as the custom actions.

BR
pwr
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: custom action with DLL returns 1723

Hi,

The sample I've provided can be used to create a more easy to configure custom action, Win 32 DLL. For this you need to use the exact function signature as
in the example. This will allow Windows Installer to detect the exported function and also have access to public properties (getters and setters) directly from your code.

The custom action which you are trying to configure, "Call Function from Standard DLL" is more difficult to configure on your side, as problems can appear in passing parameters,
calling methods or return values.

The sample I've given is indeed used for serial validation, but the same DLL can be used in Custom Actions page. Just select the standard action after which you want
to be executed, lets say "Install" standard action. Right click on it and select "New Attached Custom Action", then select your DLL. After this all you have to do
is to specify the function name in the corespondent field and set other options, like the execution condition.

Basically, all you need to do is to change the signature of you current function and use "MsiGetProperty" calls to obtain the value of your input parameters
from certain properties in which you store them. Then you can use "MsiSetProperty" calls to set the results computed in any new public property that you want.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”