Old 22nd October 2007, 08:44   #1
chjfth
Junior Member
 
Join Date: Feb 2007
Posts: 13
Unhappy nsExec bug, probably, erroneous first run behavior

On a Windows machine that nsExec::Exec has never run before, execute a installer generated by the following nsi script:

code:

Name "nsExec Test"

OutFile "nsExec-Test.exe"

ShowInstDetails show

Section "Silent MakeNSIS"
nsExec::Exec "regYYY"
Pop $0 # return value/error/timeout
DetailPrint ""
DetailPrint " Return value: $0"
DetailPrint ""
SectionEnd




Of course, you don't have regYYY.exe on your Windows, but you'll get "Return value: 0" , which means execution success [:-(]. However, a second run of the very installer on the same machine will give the result "Return value: error".

You can easily reproduce this symptom by installing a virtual machine software with snapshot functionality, e.g. WMWare Workstation(you are well off making a snapshot before first launching the installer).

Does any developer guy know what the problem is? I'm using NSIS v2.31 .
chjfth is offline   Reply With Quote
Old 22nd October 2007, 23:58   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Works fine for me returning error every time. Have you been able to reproduce this on more than one VM? Which OS? Which configuration? Reboot helps?

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 23rd October 2007, 02:54   #3
chjfth
Junior Member
 
Join Date: Feb 2007
Posts: 13
Thank you Kichik, before I post this topic, I tried it on two virtual machines, one is Win2k SP4, the other is WinXP SP2(both are simplified Chinese version).

Since Kichik says he tried himself and did not find this problem, I tried again on a new Windows Win2K system(English version). This time nsExec behaves correctly as well. So I suspect that this problem can only be seen on simplified Chinese versions of Windows.

Please download this VMware virtual machine(simplified Chinese Win2k) and try again for me. http://down.nlscan.com/Misc/Internet...-nsExec-bug.7z

BTW: On every reboot of that Win2K VM, we got 0 from nsExec::Exec, a second run after reboot gives the correct result, i.e, "error".
chjfth is offline   Reply With Quote
Old 23rd October 2007, 03:20   #4
chjfth
Junior Member
 
Join Date: Feb 2007
Posts: 13
Why is my URL submitted hidden by the forum? That URL is:

down.nlscan.com/Misc/Internet-Keep-Ref/_vmware-5-Win2kchs-nsExec-bug.7z
chjfth is offline   Reply With Quote
Old 23rd October 2007, 19:48   #5
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Your URL is hidden because you're a new user. I get 404 on both posted URLs.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 24th October 2007, 00:50   #6
chjfth
Junior Member
 
Join Date: Feb 2007
Posts: 13
Oh sorry, that URL is correct, but the damn IIS6 by default refuses to serve files with the unknown extension name .7z . Now I've corrected it. Please download and try.
chjfth is offline   Reply With Quote
Old 24th October 2007, 19:41   #7
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
I get a really lousy download speed of 3kb/s and even that is for no longer than a minute straight which is followed by at least 5 minutes of nothing. Can you upload it to a stabler website?

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 25th October 2007, 00:56   #8
chjfth
Junior Member
 
Join Date: Feb 2007
Posts: 13
Well Kichik, that address is on a server of the company I work for which locates in China. It may be slow for you, so feel free to use any download manager(e.g. FlashGet) to get it. You know, it is hard to find a globally fast website that will gladly host a file larger than 300M bytes. This nsExec issue is not urgent for me. So I can wait several weeks.

Or, if you can get a ISO of Windows 2000/XP simplified Chinese installation disk, you can try installing it on a VM, and I think the problem can be reproduced.
chjfth is offline   Reply With Quote
Old 25th October 2007, 18:39   #9
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Well, there's RapidShare, Sendago and others. But I'm still downloading anyway... When it's done, I'll have a look.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 9th November 2007, 17:32   #10
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
I found and fixed the problem. The internal process nsExec calls never called ExitProcess but only returned its result on WinMain. If there were any threads attached to that process for some reason and they exited after the main thread, the end result would be their result and not the executed program's result.

I still don't know exactly what caused this to happen just on the first execution in your VMWare, but I don't have time to debug it right now.

This might have even caused some issue someone once reported about nsExec never returning at all. If there's another thread that won't die until ExitProcess is called, it might cause this.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 10th November 2007, 13:49   #11
chjfth
Junior Member
 
Join Date: Feb 2007
Posts: 13
Thank you Kichik. I'm thankful for your responsiveness.
chjfth is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump