Installer Interaction with Macro

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
winstein
Pro Scripter
Posts: 84
Joined: Mon Nov 26, 2012 3:44 pm

Installer Interaction with Macro

Post by winstein » Wed Sep 07, 2022 9:52 am

When I want to use the Macro to input commands to run an installer, it appears that the program failed to interact with it, so for example, clicking the "Next" button will not work. The program seems to recognise that the installer exists, because GetActiveWindow can recognise it.

Is there any way around this, or is this something that cannot be worked around?

(I'm using version 14.2.03, so if this is fixed in a later update, do mention it)

Thank you for reading.
PPQ

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1380
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Installer Interaction with Macro

Post by Dorian (MJT support) » Wed Sep 07, 2022 10:41 am

Is it possible the installer is running as admin but Macro Scheduler isn't?
Yes, we have a Custom Scripting Service. Message me or go here

winstein
Pro Scripter
Posts: 84
Joined: Mon Nov 26, 2012 3:44 pm

Re: Installer Interaction with Macro

Post by winstein » Wed Sep 07, 2022 10:49 am

I guess it should be the reason. But then, would the same have to be done if using the EXE file, open it as administrator?
PPQ

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1380
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Installer Interaction with Macro

Post by Dorian (MJT support) » Wed Sep 07, 2022 11:11 am

For anything that is elevated, Macro Scheduler (or a compiled macro) also needs to be running elevated.

It's worth trying to see if that resolves your issue. More info : Controlling Apps that Run as Admin.
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Installer Interaction with Macro

Post by JRL » Wed Sep 07, 2022 7:39 pm

One thing not mentioned in the "Controlling Apps that Run as Admin" blog is that any program started by a program that is elevated is also elevated. What I've done in cases such as yours is to create my Macro Scheduler executable such that it requires running as admin so I don't forget that it needs elevated privileges, then have my executable start the program I want to control.

Opening lines of a script to test for Admin rights.

Code: Select all

WriteLn>c:\windows\system32\test~.Text,wres,Delete me

If>wres=0
  DeleteFile>c:\windows\system32\test~.Text
  MDL>success
Else
  MDL>This program must be run with elevated privileges.
  Exit>0
EndIf

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts