sagaru
Posts: 10
Joined: Wed Sep 23, 2015 5:42 pm

Custom action to EXE file fails during installation

Hello,

I'm new to advance installer, I am trying to add a custom action to an exe file. The output MSI file throws the following error during installation
There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor.
The same exe file if I try to run on a command prompt it works fine.

Code: Select all

abc.exe install filename.dll -codebase
I followed your user guide to setup custom action (http://www.advancedinstaller.com/user-g ... e-with-dir)

Below is the procedure I followed to setup custom action
  • File Path: APPDIR\abc.exe
    Command Line - install "[APPDIR]\filename.dll" -codebase
    Working Directory - APPDIR
I tried adding custom action from
Installed files
,
New Custom actions
too but ended up with the same result.

Please let me know where I might be going wrong, Ig you need I can send a sample project.

PS: Since the autoregistration of COM dll failed, I'm following this way to register dll via exe file
http://www.advancedinstaller.com/forums ... 863#p83863
bstienst
Posts: 2
Joined: Thu Sep 24, 2015 4:35 pm

Re: Custom action to EXE file fails during installation

Look in %localappdata%\Temp for the log file for the installation.

The first line will be something like this:

Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor.
Action: LaunchExeWithDirectory, location: [Your Directory] ,
command: "abc.exe install filename.dll -codebase"

More than likely you are running the command before the file exists. I'm struggling with this right now and I had to move my custom action to the end of the Install Execution Stage.
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Custom action to EXE file fails during installation

Hi,

The problem may be caused by the "\" character that is added after the "[APPDIR]" property in the "Command Line" filed. That character already exists at the end of the "APPDIR" path and by adding it again it will be doubled. Can you remove that character and see if it works?

If not, can you please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com, so we can investigate them?

In order to make sure that your files are available on the machine when the custom action tries to use them, you need to add your custom action after the "Install Execution Stage -> Add Resources" action group and set the "deferred" with "no impersonation" options for it.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sagaru
Posts: 10
Joined: Wed Sep 23, 2015 5:42 pm

Re: Custom action to EXE file fails during installation

Hello Eusebiu,

Thanks for response, nope below are the options that I tried
  • install "[APPDIR][#abc.dll]" -codebase
    install "APPDIR\abc.dll" -codebase
    install "[#abc.dll]" -codebase
    install "[APPDIR]abc.dll" -codebase
Yes my custom actions are in "Install Execution Stage -> Add Resources" action group, I have tried with "deferred" with "no impersonation" setting, even I tried placing my custom actions in Finish execution stage, then changing execution time to "After the file has been successfully modified" but ended up with same error.

Sure I'll send the project and log files to support.

@bstienst
Thanks, ya same message as you described in log files.

I have added the files required for custom action to project using the “Files and Folders” page. So I'm not running the command before the file exists I guess.

Keep me informed if you have some lead, I'll let you know if it works for me.
sagaru
Posts: 10
Joined: Wed Sep 23, 2015 5:42 pm

Re: Custom action to EXE file fails during installation

Hello Eusebiu,

I'm sending the files here as some of the project files are not supportted via email and its supportted here.

I have attached the project file(support.aip), supporting files(support.zip) and the log file here.

In case if I use

Code: Select all

install "[APPDIR][#filename]" -codebase
in cmd line it'll not through error but the installation ll be improper.

If the installation is success we should be able to see the corresponding registry entries in the following registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers
you can test it by extracting the attached zip file and executing the following cmd

Code: Select all

srm.exe install ReadOnlyFileIconOverlayHandler.dll -codebase
Looking forward for your response.
Attachments
support.zip
(276.95 KiB) Downloaded 822 times
support.aip
(12.81 KiB) Downloaded 956 times
MSI86c96.LOG
(1.28 KiB) Downloaded 819 times
sagaru
Posts: 10
Joined: Wed Sep 23, 2015 5:42 pm

Re: Custom action to EXE file fails during installation

Any update on this?
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Custom action to EXE file fails during installation

Hi,

Sorry for the delayed reply.

I tested your project and I found that the command line sent to your custom actions was not correct. It should be as follows:

Code: Select all

install "[APPDIR]ReadOnlyFileIconOverlayHandler.dll" -codebase
Also, the uninstall custom action is not placed at the appropriate point. It should be placed before the "Remove Resources" action group because during the uninstallation, all the files will be removed after that point and the custom action will not be able to call them anymore.

I attached your project with the changes mentioned above which worked in my tests.

Best regards,
Eusebiu
Attachments
support.aip
(12.57 KiB) Downloaded 852 times
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sagaru
Posts: 10
Joined: Wed Sep 23, 2015 5:42 pm

Re: Custom action to EXE file fails during installation

Hello Eusebiu,

Thanks a lot for posting the solution, it worked indeed.
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Custom action to EXE file fails during installation

You're welcome. I'm glad I could help.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jdshkolnik
Posts: 14
Joined: Tue Mar 22, 2016 3:40 pm
Contact: Website

Re: Custom action to EXE file fails during installation

Hi,

I'm getting a similar error. I just began playing with our AI Enterprise license. All I have is a single custom action which results in the following error:

Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: LaunchExeWithDirectory, location: C:\Users\JSHKOL~1\AppData\Local\Temp\Installer\, command: "nant-0.92\bin\nant.exe" -buildfile:InstallDatabase.build -D:BuildConfiguration="Debug" -D:ClientName="Internal" -D:ForecastDatabaseName="Internal_GuineaPig_150_C109_build524" -D:HubDatabaseName="Internal_HubTest_150_C109_build524" -D:InstanceType="CI_150_C109_build524" -D:IsOverwrite="True" -D:IsUnattended="True" -D:SAUser="sa" -D:ServerName="local_dev" -D:SkipLDC="True" -D:SSRSLocalUrl="http://localhost/reportserver" -D:SSRSPassword="NULL" -D:SSRSRemoteUrl="http://localhost/reportserver" -D:SSRSRootFolder="/Internal/Forecast/CI_150_C109_build524/Reports/" -D:SSRSUserName="NULL"

If I go to the temp directory while the error popup is still on the screen and run the above command manually, it works as expected. The package is set to run as administrator.
John D. Shkolnik
Senior Manager
Financial Technology
Deloitte & Touche LLP
jdshkolnik
Posts: 14
Joined: Tue Mar 22, 2016 3:40 pm
Contact: Website

Re: Custom action to EXE file fails during installation

I figured it out. For future reference, the file path field isn't relative to the working directory. I got it to work by setting the value to "[Installer_Dir]nant-0.92\bin\nant.exe"
John D. Shkolnik
Senior Manager
Financial Technology
Deloitte & Touche LLP
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Custom action to EXE file fails during installation

Hello John,

I'm glad you got this working. Thank you for sharing your solution with the community.

If there is anything we can assist you with just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
shank
Posts: 11
Joined: Fri Jul 15, 2016 3:28 am

Re: Custom action to EXE file fails during installation

Hi,

Is this particular fix or guide to this fix documented anywhere? I am having the same issue.. i need to run an exe with command line switches after the install to fix up file associations, but i keep getting the same error here regardless of which custom action method i chose.

Thanks!
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Custom action to EXE file fails during installation

Hello,

Can you please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them?

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

Return to “Building Installers”