sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Temporary Bat File Not Running As Custom Action

Guys,

It looks like my file is not being found, i.e. no file name in command:

MSI (s) (00:24) [17:39:04:081]: Executing op: ActionStart(Name=Register_COM_Servers.1774B61E_82C4_4E8C_8FBA_A705BBC46365,,)
Action 17:39:04: Register_COM_Servers.1774B61E_82C4_4E8C_8FBA_A705BBC46365.
MSI (s) (00:24) [17:39:04:081]: Executing op: CustomActionSchedule(Action=Register_COM_Servers.1774B61E_82C4_4E8C_8FBA_A705BBC46365,ActionType=3074,Source=BinaryData,Target=/RunAsAdmin /HideWindow /dir "C:\Program Files (x86)\Cicero Inc\CIC\Bin\" "",)
CustomAction Register_COM_Servers.1774B61E_82C4_4E8C_8FBA_A705BBC46365 returned actual error code -1 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) (00:24) [17:39:04:128]: Note: 1: 1722 2: Register_COM_Servers.1774B61E_82C4_4E8C_8FBA_A705BBC46365 3: C:\Windows\Installer\MSI37F7.tmp 4: /RunAsAdmin /HideWindow /dir "C:\Program Files (x86)\Cicero Inc\CIC\Bin\" ""

The CA definition looks like this:
Com_registers.PNG
Com_registers.PNG (19.28 KiB) Viewed 8520 times
for "File To Launch" I tried prepending "&" as well.
temp_file.PNG
temp_file.PNG (24.01 KiB) Viewed 8520 times
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Temporary Bat File Not Running As Custom Action

Hello Scott,

I have investigated this and indeed, you are right. It seems that the file (.bat file) added as a temporary file in a MSM project is not launched from within the main project. This seems to be an issue in what regards Advanced Installer. From my investigations, it seems that the .BAT file is correctly extracted into the %temp% folder, but somehow Advanced Installer seems to be unable to find it. In my tests, when the custom action ("Launch File") was to be executed, a Windows Explorer window was popping up, meaning that the file could not be found.

I have forwarded this to the developers team and hopefully this will be fixed in a future version of Advanced Installer.

Unfortunately, I can not give you any estimation on when this will be fixed nor was I able to find any workaround for this issue.

Thank you for your understanding.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: Temporary Bat File Not Running As Custom Action

Thanks Catalin! Thought I was going crazy. I agree, I saw the .bat file in the TEMP folder as well.
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Temporary Bat File Not Running As Custom Action

You're always welcome, Scott.

Forgot to mention in my last thread: I will update this thread as soon as a fix will be available.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Temporary Bat File Not Running As Custom Action

Hello Scott,

After further investigating this, I was able to find a workaround for this. To overcome this issue, you can proceed as it follows:

- In the MSM project, go to "Table Editor" --> "AI_TempFile" table --> take the temporary file property (it should look something like this: AI_SOMETHING.MERGE_MOD_GUID. Copy and paste it.

- Now please go to "Custom Actions" page and in the "File to launch" field of your "LaunchFile" custom action, paste the earlier copied property and enclose it between square brackets like this: [AI_SOMETHING.MERGE_MOD_GUID]

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
alf
Posts: 7
Joined: Thu Feb 06, 2020 12:44 pm

Re: Temporary Bat File Not Running As Custom Action

I have the same problem with a batch file that should be launched before the install process starts.
The file (Uninstall_ssl.bat) is available in the users local temp folder just when the Setup is started. I checked that it's really there while the installation is running. But I always end up with an error 1722 - I think it's a because the batch file couldn't be found by the installer.

I checked the workaround by coping the AI_TempFile property name [AI_UNINSTALL_SSL.BAT] and use this as the file to launch.
But the error 1722 occurs again.

Any help for this? I need a batch file to uninstall an ssl certificate right before the install/update of a produkt.
The batch file reads a port out of a config file and should uninstall the certificeate before the update process begins.
Called manually from the target machine the batch runs fine. But I always get that awful 1722 when calling it in the installer.

Any help would be greatly appreciated.
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Temporary Bat File Not Running As Custom Action

Hello Alf,

As you can see, the above problem was encountered when the .BAT file was added as a temporary file in a MSM file.

Unfortunately, from your last thread, I can not really say if your problem is the same (i.e. your .BAT file is added in a MSM file). Could you please confirm that this is the case for you as well?

If this is not the case, please make sure that your custom action is added after the "Path Resolution" action group ("Wizard Dialogs Stage"), as during that group the files are copied on the target machine (more specifically, during the "CostFinalize" action).

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Temporary Bat File Not Running As Custom Action

Hello,

This has been fixed in version 17.1 of Advanced Installer, released on May 27th, 2020.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: Temporary Bat File Not Running As Custom Action

Catalin, thanks for letting us know!
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Temporary Bat File Not Running As Custom Action

You are always welcome, Scott!

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

Return to “Common Problems”