MWI
Posts: 4
Joined: Mon Jul 18, 2022 1:35 pm

Custom Action fails with return value '3'

We are trying to install one of our products on a customer system. In the MSI there is a dialog where we invoke a Custom Action from a DLL when the user clicks "Next". The custom action is very simple, it is basically just a string.Replace, however the action instantly returns with the value '3'.
Here are the logs:
MSI (c) (88:20) [12:59:10:372]: PROPERTY CHANGE: Modifying MSSQL_SERVER property. Its current value is 'localhost'. Its new value: 'dbserver'.
MSI (c) (88:20) [12:59:16:389]: PROPERTY CHANGE: Modifying MSSQL_DATABASE property. Its current value is 'Database'. Its new value: 'MyDatabase'.
MSI (c) (88:20) [12:59:16:483]: PROPERTY CHANGE: Deleting CHECK_MSSQL_CREATEDB property. Its current value is 'Selected'.
MSI (c) (88:20) [12:59:24:878]: PROPERTY CHANGE: Modifying MSSQL_USERNAME property. Its current value is 'sa'. Its new value: 'MyUser'.
MSI (c) (88:20) [12:59:30:631]: PROPERTY CHANGE: Adding MSSQL_PASSWORD_PROP property. Its value is '**********'.
MSI (c) (88:20) [12:59:30:741]: PROPERTY CHANGE: Modifying MSSQL_PASSWORD property. Its current value is 'MSSQL_PASSWORD'. Its new value: 'abc123'.
MSI (c) (88:20) [12:59:30:741]: PROPERTY CHANGE: Adding STRING.REPLACE.VALUE property. Its value is 'abc123'.
MSI (c) (88:20) [12:59:30:741]: PROPERTY CHANGE: Adding STRING.REPLACE.OLDVALUE property. Its value is '}'.
MSI (c) (88:20) [12:59:30:741]: PROPERTY CHANGE: Adding STRING.REPLACE.NEWVALUE property. Its value is '}}'.
MSI (c) (88:20) [12:59:30:741]: Doing action: StringReplace
Aktion 12:59:30: StringReplace.
Aktion gestartet um 12:59:30: StringReplace.
MSI (c) (88:88) [12:59:30:952]: Invoking remote custom action. DLL: C:\Users\a014\AppData\Local\Temp\MSI1E5.tmp, Entrypoint: StringReplace
Aktion beendet um 12:59:33: StringReplace. Rückgabewert 3.
Information 2896. Das Ausführen der Aktion StringReplace schlug fehl.

Now the curious part is, that on most systems, this works without any issues, but there are a few of our customers, where the installation fails.

What could be the issue here?

Thank you for your help!
Catalin
Posts: 7504
Joined: Wed Jun 13, 2018 7:49 am

Re: Custom Action fails with return value '3'

Hello,

The most common point of failure for custom actions called from a file (either a ps script or a dll file) is the fact that the file is not present when the user try to execute the custom action.

However, this is not the case for your since this works just fine for most customers.

That being said, you will have to investigate why this is happening. A common way of doing so is by adding different debug messages in the custom actipon's code and then check the log to see exactly what line is failing. Then we would need to further investigate this to see what is causing the failure on those specific machines, as there has to be something that is causing this (e.g. a permission issue).

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
MWI
Posts: 4
Joined: Mon Jul 18, 2022 1:35 pm

Re: Custom Action fails with return value '3'

Hi Catalin,

thanks for your reply.

We managed to find out, that some of the referenced assemblies in the CustomAction DLL were missing and not correctly loaded.
It seems, that on the machines where the installer worked, the missing DLL was already in the GAC from another application.

Unfortunately though, we now encounter a new issue one the system when the CustomAction is being executed.

We get the Error

There was a problem starting C:\Users\ex27\AppData\Local\Temp\MSI8428.tmp
Access is denied.

Can you maybe help with that? The setup is being executed with elevated (admin) rights.

EDIT:
My colleague installed an older version of our software (and an older version of our CustomActions DLL) on the same system yesterday (same user) and that worked.

Could this maybe be an anit virus issue or something like that?

Thank you!

Best regards,

Mike
Catalin
Posts: 7504
Joined: Wed Jun 13, 2018 7:49 am

Re: Custom Action fails with return value '3'

Hello Mike,

You are always welcome, glad you managed to find the culprit!

Regarding the new error, it indeed might be an antivirus issue or some permission issues.

For instance, if you disable the antivirus product, are you able to run the custom action?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”