How to hide command prompt windows (custom actions) - Advanced Installer Community

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!

valiot
Posts: 80
Joined: Tue Dec 04, 2012 1:41 am

How to hide command prompt windows (custom actions)

I have several command line custom actions I'm doing. However, they popup some ugly command prompt windows. Is there a way to run the command line actions with these windows minimized or hidden?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to hide command prompt windows (custom actions)

Hi,

You can follow the How do I hide the command window of a custom action article. Another way to do this is described in the running batch file in backgound thread.

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
valiot
Posts: 80
Joined: Tue Dec 04, 2012 1:41 am

Re: How to hide command prompt windows (custom actions)

If I have switches to run with the EXE, how do I specify them? It's not described in the help doc.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to hide command prompt windows (custom actions)

You can write your switches right after your file name in the "Action Data" text field like in the example:

Code: Select all

[#MyFile.exe] /switch1 /switch2
Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
valiot
Posts: 80
Joined: Tue Dec 04, 2012 1:41 am

Re: How to hide command prompt windows (custom actions)

I'm having problems with this. It's not working. I'm trying to call a temp file:

[Manufacturer_Dir]>[&txtedit.exe] /switch
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to hide command prompt windows (custom actions)

Hi,

I've tested your scenario and everything worked well to me. Can you please send us the .AIP (project file) and a verbose log of the installation so we can investigate them?

It might not work if you do not run your custom action as "deferred" with "no impersonation".

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
valiot
Posts: 80
Joined: Tue Dec 04, 2012 1:41 am

Re: How to hide command prompt windows (custom actions)

I found the cause of the problem but I don't know how to fix it.

If I run my installer on a clean machine it works fine and the command line actions execute. However, they do not execute if I am upgrading a previous version of my app.

I was monitoring the folder where the temporary file is placed. I notice that the temp file was created at the start but was removed at the end of the uninstall process of my previous app. It was never put back. So this is why the command-line did not run in my installer because the temp file was not there (it was deleted by uninstall process). So how can this happen and how do I fix it?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to hide command prompt windows (custom actions)

Hi,

Indeed, this happens when the old version of the product is uninstalled. To overcome this you can follow the steps below:
- in your [Manufacturer_Dir] folder create a new folder named [|ProductVersion] and move your temporary file in it
- then in the "Action Data" text field of your custom action you can use the following string:

Code: Select all

[Manufacturer_Dir]\[ProductVersion]>[&txtedit.exe] /switch
Let us know if this helped.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
valiot
Posts: 80
Joined: Tue Dec 04, 2012 1:41 am

Re: How to hide command prompt windows (custom actions)

Strange. [|ProductVersion] does not resolve during install. It just creates a folder called ProductVersion.
2013-04-05_1320.png
2013-04-05_1320.png (38.81 KiB) Viewed 12399 times
valiot
Posts: 80
Joined: Tue Dec 04, 2012 1:41 am

Re: How to hide command prompt windows (custom actions)

Ok, I fixed the issue. I deleted the folder and re-created it and now it resolves correctly. But now the command doesn't run.

BTW, I had to change the action data to:

Code: Select all

[Manufacturer_Dir][ProductVersion]\>[&txtedit.exe] /switch
Because the [Manufacturer_Dir] contains the trailing slash but [ProductVersion] does not.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to hide command prompt windows (custom actions)

Hi,

Can you please try the command I wrote in my previous post or even a command that doesn't contain any slash character and see if the behavior persists?

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

Return to “Common Problems”