Archive: MDAC install and nopey


MDAC install and nopey
i need to install mdac in silent mode. mdac must be installed with administrators rights so i'm using nopey addin with runas option. mdac version is checked and if necessary mdactyp is executed directly from inside the main nsis script which is actually installing my application.
the relevant part of the code here:

nsExec::ExecToStack /TIMEOUT=5000 '"$INSTDIR\mdac_typ.exe" /q:a /c:$\"setup /qn$\"'

(note: i choosed nsexec because ExecWait doesn't work well).

MDAC installation is correctly launched and it runs silently upon completion; the problem is that the main scripts goes on without waiting for mdac setup completion.
I believe that nsExec is waiting for 'mdac_typ' execution while the 'real' process to be waited for is 'setup' which is inside the mdac package.

i can't unpack mdac_typ and launch nsexec......'setup /qn'
because too many files inside mdac package; in addition, mdac can run other sub-setups inside depending on system settings.

Any idea on how to get rid of this situation ?
note that the main script (which calls mdac) is launched by another small loader which uses nopey to get administrator rights:

File /oname=$R0 "${NSISDIR}\contrib\nopey\nopey.exe"
nsExec::ExecToStack '"$R0" runas
localadmin:adminpwd "myapp.exe"' ('myapp.exe' then launches mdac if needed).


thanks in advance.


This page contains information about installer switches. The InstallShield part shows how to make InstallShield wait for its forked processes. It might also contain such information about the setup engine your MDAC installer uses. I think there was also a forum thread about this a few months ago. Search the forum for "MDAC", you might find something useful.


thanks
thanks kichik. i did search forums for 'mdac' but no posts really helped me so i opened this request.
the link you sent seems enough to help. i'm studying on it.
i just wonder what to do with zip/rar self-extract files where you set to execute a program after extraction. in that case you don't have a .msi installer like mdac but the scenario is the same (nsexec self-extract package while you need to wait for the program you're going to launch).
just a thought.
paolo


Wrong button?

-Stu


*merged*


After launching the mdac install.. just wait until the process dies.


... Exec MDAC ...
sleep 5000
FindProcDLL::FindProc "MDAC_TYP.EXE"
strcmp $R0 "1" -2 0

not an msi
i thank you all for contributes but nothing really helps.
MS mdac distribution (mdac_typ.exe) is not an msi so it doesn't accept msi paramters, especially /sms that would be the one really needed in this case.
Also, it doesn't help wait for mdac_typ completion: nsExec already does.
The issue is that mdac_typ launches the internal setup and closes so that nsExec is looking only on mdac_typ completion then the main script goes on.
I guess i have only two options at this time:
1. look for an official MS mdac package distributed as msi (if any)
2. try to unpack and repack the original mdac_typ so to be able to manage directly the internal setup. i've laready tried this but it seems it doesn't accept paramters at all.


Merged again. Click the Post a Reply button, not the Post a new Topic button.


thanks
thank you & sorry for that.


Workaround with CheckProcess
At present, the only workaround i found was to check-if-mdac_typ-process is running, some thing like this:
section .OnInit
GetTempFileName $1
File /oname=$1 "${NSISDIR}\contrib\CheckProcess\CheckProcess.exe"
loop:
nsExec::ExecToStack '"$1" mdac_typ'
pop $0
strcmp $0 "1" 0 nonrunning
messagebox mb_ok "mdac_typ is running" ; test
sleep 2000
goto loop
nonrunning:
messagebox mb_ok "mdac_typ is not running" ; test
goto end
end:
; proceed with main installation...
sectionend

CheckProcess is a contribute i found in this forum: it's not fast but it works.
I don't like such this solutions but at this moment i have no other idea.
tks.


Workaround with CheckProcess
At present, the only workaround i found was to check-if-mdac_typ-process is running, some thing like this:
section .OnInit
GetTempFileName $1
File /oname=$1 "${NSISDIR}\contrib\CheckProcess\CheckProcess.exe"
loop:
nsExec::ExecToStack '"$1" mdac_typ'
pop $0
strcmp $0 "1" 0 nonrunning
messagebox mb_ok "mdac_typ is running" ; test
sleep 2000
goto loop
nonrunning:
messagebox mb_ok "mdac_typ is not running" ; test
goto end
end:
; proceed with main installation...
sectionend

CheckProcess is a contribute i found in this forum: it's not fast but it works.
I don't like such this solutions but at this moment i have no other idea.
tks.


correction to previous post
i found that CheckProcess needs .net installed so it can't be used for my purposes. i use instead userfunction with this code:

CheckIfMDACIsRunning:
mdacloop:
FindProcDLL::FindProc "dasetup.exe"
strcmp $R0 "1" 0 NotRunning
sleep 2000
goto mdacloop
NotRunning:
goto MDACOK
MDACOK: