Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Starting an install
Hello all,
I have taken over for someone who left our company. I have Quick Macros installed and I have edited an existing project (Macro).
The Macro assists in an applications update. Here is what it does:
1 Kills the app
2 stops IIS
3 copies new files into Virtual directories
4 starts IIS
5 starts app

I have an install shield Basic MSI service install. (MSDSS.exe)
I have tried to fire the setup.exe directly and via a .bat file.
run "C:\EEMS\Update\MSDSS.bat" "" "" "" 16|0x10400; err ret

Both methods work from inside Quick Macros when I run it from the tool bar.
However once i build the Macro .exe, it will not fire the install when executed outside of Quick Macros.
The other steps 1-4 work as expected.

I have noticed that step 5 does not allways happen either. it is another .exe call.
run "$program files$\EEMS\EEMS.EXE" "" "" "" 16|0x10100; err ret

what am I missing?
run flag 0x10000 works differently in Quick Macros and macro.exe.
In QM: The program will run as administrator, without a UAC consent or password dialog.
In macro.exe: The program will run as administrator, but: if macro.exe itself is running not as admin, it will show a UAC consent or admin password dialog. It is like you right-click program's icon in Windows Explorer and select "Run as administrator". The same in portable QM. It is because to start a program as admin need a service, it is unavailable where QM is not installed.
I did try rightclicking and select Run as Administrator on the Macro.exe - with the same result...
We have been using this macro.exe for years.
the restarting of the app in step 5 has mostly worked over those years.
I had noticed occasionally that the app did not "restart".
so i guess some pcs are not logged on as admin.
is there any way around this?
Try to remove flag 0x10000 and run macro.exe as admin.

Also try Windows API directly:
ShellExecute 0 0 "C:\EEMS\Update\MSDSS.bat" 0 0 0

On non-admin accounts try RunAs.
RunAs "C:\EEMS\Update\MSDSS.bat" "" "admin username" "" "admin password"

Also try RunConsole2.
RunConsole2 "C:\EEMS\Update\MSDSS.bat"

Also, maybe need to pass correct "current directory". All the above functions support it. Default "current directory" probably is different in QM and in macro.exe, and it may be the reason.
I will work these recommendations now and let you know.

In the Macro, he has
int v1688
v1688=run("NET.exe" "stop W3SVC" "" "$system$\" 16|0x10400); err ret

This runs no-matter what. Other than returning a flag or err code for use later (which he doesnt), what is the difference using the run this way.
If this is for a different forum, please let me know.
Only other file to run, and passes "current directory", no more differences.
There may be more information, I didn't think it was relevant earlier.
The Macro.exe is actually shelled from a VB6 app (the app it kills and restarts)
would that affect the Macro.exe rights, being called from an app with admin rights.
If it does, i have not been testing correctly.
RunAs "C:\EEMS\Update\MSDSS.bat" "" "admin username" "" "admin password"
dont know unames and pwds, cant use.

RunConsole2 "C:\EEMS\Update\MSDSS.bat"
No change

ShellExecute 0 0 "C:\EEMS\Update\MSDSS.bat" 0 0 0
caused Windows Explorer to crash first time I ran it. after that, no change.
I want to explore the shell more in syntax and options.
ShellExecute ... 85%29.aspx

Forum Jump:

Users browsing this thread: 1 Guest(s)