|
|
#1 |
|
Junior Member
Join Date: Jun 2004
Posts: 6
|
ExecShell doesn't work in all computers
Hi! I'm newbie with NSIS and my problem is that my instalation file works fine in my computer, but it doesn't work in another computers. The problem is in the ExecShell instruction, I try to execute a batch file that is ignored in other computers. Could anybody help me?
I've tried nsExec::Exec but this instrcution is ignored in my computer too. Thanks in advance and excuse my poor english. |
|
|
|
|
|
#2 |
|
Senior Member
|
I don't know for what you use the batch file, but maybe
Exec or ExecWait could do the job |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jun 2004
Posts: 6
|
No, I can't use Exec or ExecWait. I'm using the batch file for running this command: "mysql-opt -standalone", if I use Exec it appears a black screen that I want to eliminate using ExecShell.
|
|
|
|
|
|
#4 |
|
Senior Member
|
is the Batch file not executet or does it only not work correctly on the other systems...maybe on other sys your command can't be understand properly
|
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Jun 2004
Posts: 6
|
If I use the same batch file with Exec sentence, the batch works in all computers but a black screen is shown, so the problem isn't the batch file or the command, it must be the ExecShell.
|
|
|
|
|
|
#6 |
|
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
Two links from 2-nd forum page
![]() http://forums.winamp.com/showthread....hreadid=179975 http://forums.winamp.com/showthread....hreadid=181442 Try SW_HIDE first |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Jan 2004
Location: London, Ontario, Canada
Posts: 272
|
Why not use nsExec?
nsExec ------ nsExec will execute command-line based programs and capture the output without opening a dos box. Usage ----- nsExec::Exec [/TIMEOUT=x] path -or- nsExec::ExecToLog [/TIMEOUT=x] path -or- nsExec::ExecToStack [/TIMEOUT=x] path See the documentation, it's all in there..... |
|
|
|
|
|
#8 | |
|
Junior Member
Join Date: Jun 2004
Posts: 6
|
Quote:
My code is: code: nsExec doesn't work in any computer, exec works in all and execShell only in my computer. Somebody could tell me if there is something wrong? |
|
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Jan 2004
Location: London, Ontario, Canada
Posts: 272
|
oh, nsExec works, but since NSIS is a win32 application no matter what you get the prompt back instantly. If you check your process viewer, you will notice your batch file is running.
I had a similar issue, and had to write a C function that waits for the process to end before returning to the user. I also requested that this functionality be added to nsExec, as nsExec::ExecWait. But have not seen it appear in CVS as of yet. You can read the thread here. |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Jun 2004
Posts: 6
|
Well, I've checked my process viewer and my problem is opposite to yours, my instalation file is stopped waitting batch file ending. I want to nsExec doesn't wait, how can I do that??
|
|
|
|
|
|
#11 |
|
Senior Member
Join Date: Jan 2004
Location: London, Ontario, Canada
Posts: 272
|
nsExec::Exec "$4\mysql\bin\mysql.bat"
|
|
|
|
|
|
#12 |
|
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
What about this?
System::Call 'kernel32.dll::WinExec(t "mysql.bat", i 0) i.r0' |
|
|
|
|
|
#13 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
Is the file associated set correctly?
|
|
|
|
|
|
#14 | |
|
Junior Member
Join Date: Jun 2004
Posts: 6
|
Quote:
Thanks a lot to everybody |
|
|
|
|
|
|
#15 |
|
Junior Member
Join Date: Nov 2007
Location: paris
Posts: 8
|
System::Call 'kernel32.dll::WinExec(t "c:\temp\mybat.bat", i 0) i.r0' works well to launch a .bat file at the end of the NSIS installation process. Problem: WinExec executes the .bat file from ...\My documents (ie it's there I find .log file after the launch), whereas I'd like to be executed from the .bat repository, ie c:\temp (so as to read a .conf file).
Is there a way for it? I tried to precede "System::Call ..." with SetOutPath "c:\temp" but this doesn help... I'll appreciate any comments Cyril |
|
|
|
|
|
#16 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
If you need to run the batch file without waiting for it to finish and you cannot get Winexec working, you can make another NSIS executable that runs the batch file itself with nsExec and extract and run that at the end of your main installer with Exec.
The secondary installer code would look like this: code: Stu |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|