Old 8th September 2007, 08:34   #41
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Putting a sleeper is never the right solution. It just hides the problem a bit better. If "lighting fast" suddenly become over 5 seconds because the CPU or HD are really busy, it won't be able to hide it.

Try verifying it's the right tree first by validating the folder exists in the installer. Use IfFileExists.

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 September 2007, 18:35   #42
99999999
Junior Member
 
Join Date: Nov 2006
Posts: 43
Quote:
Originally posted by stonkers

One thing that is always the case. It fails creating a folder, and thus, it doesn't write any files to that folder. The only reason I can think of for it not being able to create the folder is because it still thinks the folder is there. So maybe it got deleted in the uninstall, but it's so lightning fast (in silent mode because of the lack of interaction), that the OS lies to NSIS saying that the folder is already there. What if I put a 5 second sleeper at the end of all of my uninstalls to give the OS time to catch up? I'll give it a shot and report back.
I also found this to be the case, it's some odd thing about the uninstaller/installer interaction.

Starting from a clean build the following were the different states after installs:

Install #1: Full install, completely successful
Install #2: Uninstall previous version, and then attempt an installation. Installation failed, because the install directory could not be created.
Install #3: Full install, (because there is no previous installation,) completely successful.

And round and round it goes. I have a couple ideas, but basically it appeared to me that the issue was related to the current installer having it's installation directory deleted, *after* it already had assumed it was there, and was ready to use.

The solution I used to prove myself more or less right, was to execute a batch file which created the directory, after ruuning the uninstall. It worked perfectly after I did that. As a result, I added a function to our custom plugin to handle this instead.
99999999 is offline   Reply With Quote
Old 2nd October 2007, 20:22   #43
stonkers
Senior Member
 
Join Date: Sep 2003
Posts: 192
I don't think I've ever had a problem with the installation directory, only subdirectories that are in the File /r command. I don't specifically tell the installer to create the directories, just let it do it when it copies them in.

There's something that is causing me to switch gears though. When it fails (not really fails, but in the deploy log I see it error on creating a directory), if I run the installer manually it works (even with the /S option). I'm investigating whether PSExec has issues with permissions possibly (seems ludicrous because I'm admin on the machine and it doesn't have problems creating all directories, just one or another).

Eric
stonkers is offline   Reply With Quote
Old 3rd October 2007, 01:53   #44
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
I'd say it's time for some debugging...

Attached is a set of stubs (for 2.31) that'd simply break into the debugger upon directory creation failure. Use them build an installer that'd be installed using psExec. On the computer where the installer is executed, install windbg and set it as the postmortem debugger. Now execute the installer using psExec and hope the magic psExec does doesn't block windbg from your desktop.

Once windbg is open, at the very least create a crash dump using .dump /ma C:\CreateDirectoryFailed.dmp and post it here.
Attached Files
File Type: 7z stubs.7z (31.1 KB, 298 views)

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 3rd October 2007, 15:45   #45
stonkers
Senior Member
 
Join Date: Sep 2003
Posts: 192
I can't get past the 7z file. Do I need to change the extension to use it or is there a specific software I have to open it with?

Eric
stonkers is offline   Reply With Quote
Old 3rd October 2007, 15:49   #46
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
No, it's just a simple 7z file. Try with the latest 7-zip.

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 3rd October 2007, 17:12   #47
stonkers
Senior Member
 
Join Date: Sep 2003
Posts: 192
OK, where do the stubs go? I'm not too versed in the inner workings of NSIS...

Eric
stonkers is offline   Reply With Quote
Old 3rd October 2007, 17:13   #48
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
C:\Program Files\NSIS\Stubs.

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 3rd October 2007, 17:16   #49
stonkers
Senior Member
 
Join Date: Sep 2003
Posts: 192
Nevermind, I found the obvious "stubs" directory.

Eric
stonkers is offline   Reply With Quote
Old 3rd October 2007, 18:07   #50
stonkers
Senior Member
 
Join Date: Sep 2003
Posts: 192
OK, I've got everything setup except the final step. So, I'm running the installer using PSExec silently from another machine. How am I going to catch the debugger open? I'm not on the machine.

Eric
stonkers is offline   Reply With Quote
Old 3rd October 2007, 18:20   #51
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
You can setup remote debugging. Set the postmortem debugging to:
code:
windbg -p %ld -e %ld. –server tcp:port=12345
Then, when it seems like psExec has frozen, try connecting to the debugger which should open on the remote computer using:
code:
windbg -remote tcp:server=1.2.3.4,port=12345
Of course you'll have to replace 1.2.3.4 with the real IP.

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 3rd October 2007, 19:51   #52
stonkers
Senior Member
 
Join Date: Sep 2003
Posts: 192
OK, thanks! I'm impressed with your windows knowledge kichik!!!

Eric
stonkers is offline   Reply With Quote
Old 26th October 2007, 17:02   #53
stonkers
Senior Member
 
Join Date: Sep 2003
Posts: 192
OK, I haven't managed to get a dump yet, but I did get a better error when I put the latest NSIS on there. When it crashes creating a folder, it says (err=5):

CreateDirectory: can't create "C:\Program Files\MyFolder\MySubfolder\TheFolder" (err=5)

Does this do anything more for you Kichik? If not, I'll get a dump. I'm thinking what I need to do is wait for it to happen and then re-build that release with the debug stubs and try to release again. The problem with this whole situation is, it's TOTALLY unpredictable when or where it's going to happen.

Eric
stonkers is offline   Reply With Quote
Old 26th October 2007, 18:55   #54
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
5 is ERROR_ACCESS_DENIED. Why weren't you be able to get a dump at that point? Right after printing that to the log, it should break into the debugger.

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 31st October 2007, 20:46   #55
stonkers
Senior Member
 
Join Date: Sep 2003
Posts: 192
I have to do a "debug build". They were in a hurry to test this build, so I didn't have time to rebuild. Next time I'll be able to do it hopefully. It seems to be happing a WHOLE lot less since upgrading NSIS (only once so far).

Eric
stonkers is offline   Reply With Quote
Old 1st November 2007, 16:09   #56
stonkers
Senior Member
 
Join Date: Sep 2003
Posts: 192
OK, this sucks!!! So I got the opportunity and did what I said I was going to. The build failed. So I set the debug stubs up and rebuilt. This time, however, everything worked fine. This caused me to dig a little deeper into why the redeploy's aren't working. Well it turns out that when I redeploy with PSEXEC, it is working. It isn't showing us that it's working because our log isn't allowing itself to be overwritten silently. So I'm going to have to catch it when it happens the first time or I won't catch it.

Is it safe to do create a debug exe everytime for just this one test environment? In other words, as a part of my build process, when I was building the exe for the test environment, have the build copy the stubs in there, run makensis, then copy the working stubs back over for creating all the other exe's...

Of course I also want to address the log issue, but that's another subject...

Again, Thanks!
Eric <><

Eric
stonkers is offline   Reply With Quote
Old 1st November 2007, 18:04   #57
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
It's perfectly safe to move over the stubs as long as you replace makensis.exe along with them.

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 2nd November 2007, 15:22   #58
stonkers
Senior Member
 
Join Date: Sep 2003
Posts: 192
I must be doing this wrong. I never understood having to replace makensis.exe. I only changed out the stubs. I was under the impression that those stubs went with the version you had told me to upgrade with. Is there a step that I missed?

Eric
stonkers is offline   Reply With Quote
Old 2nd November 2007, 18:21   #59
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Right, I gave you stubs that match makensis.exe 2.31 built with logging. As long as you switch between the normal logging stubs and the special logging stubs, makensis.exe can stay the same. But if you switch to non-logging stubs or another version of stubs, you'll have to switch makensis.exe.

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 2nd November 2007, 19:39   #60
stonkers
Senior Member
 
Join Date: Sep 2003
Posts: 192
Cool, I'll set this up so that I will get a dump whenever it chokes. Thanks Kichik!

Eric
stonkers is offline   Reply With Quote
Old 18th December 2007, 16:13   #61
stonkers
Senior Member
 
Join Date: Sep 2003
Posts: 192
Not working...

When the folder create fails, the psexec process doesn't hang. I'm guessing that these stubs aren't dumping. Should I put some sort of code in my nsi file for debug purposes to force a dump?

Eric
stonkers is offline   Reply With Quote
Old 18th December 2007, 21:54   #62
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Does it at least crash or does it carry on?

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 18th December 2007, 23:06   #63
stonkers
Senior Member
 
Join Date: Sep 2003
Posts: 192
It carry's on just like it did before the stubs were changed. Gives the can't create folder error in the log file.

Eric
stonkers is offline   Reply With Quote
Old 19th December 2007, 19:01   #64
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
What's the exact error it prints to the log?

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 20th December 2007, 15:29   #65
stonkers
Senior Member
 
Join Date: Sep 2003
Posts: 192
I believe as it creates the folder, it says (err=5), and thereafter cannot create files in that folder that doesn't exist. If this isn't the case, I'll cut, paste, and post when it happens again.

Eric
stonkers is offline   Reply With Quote
Old 20th December 2007, 21:31   #66
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Are you sure the executed installer was created with the stubs I gave you? I see no reason it'd ignore a call to DebugBreak(), even when executed with psexec. Open the installer with notepad or some text editor and look for DebugBreak.

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 7th January 2008, 20:14   #67
stonkers
Senior Member
 
Join Date: Sep 2003
Posts: 192
I believe we've fixed it (no problems for 2 weeks). It looks like IIS was sometimes blocking the installer from deleting folders. So instead of doing an "IISRESET" after the installer is done, we now do an "IISRESET /STOP" in .onInit and then an "IISRESET /START" after the installer is done.

BTW - I checked it out and the move of those stub files was failing in NAnt. Probably a typo in folder name on my part, but we won't need it this time. I'll look deeper if we need this again though.

Thanks Kichik!!!

Eric
stonkers is offline   Reply With Quote
Old 7th January 2008, 22:38   #68
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
A happy ending at last

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
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