Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 7th May 2001, 21:26   #1
moshem
Junior Member
 
Join Date: May 2001
Posts: 4
Hi

I am new to NSIS ,

when trying to register a dll I get "Error opening file for writing" , the file is not open at that time by any application.

I went to check it using sysinternals filemon , and saw that while NSIS tried to copy the file , the file system reported a "Sharing violation" .

I made another installation using the InstallWizard system , and run it while watching at FileMon , no sharing violation happend . I immediatly run NSIS based installation and got the problem again.

this is my code snippet , please tell me how to make NSIS get over the sharing violation (and any other comments you have regarding my use of NSIS)

thanks

Section "Test1"
; Set output path to the installation directory.
SetOutPath $SYSDIR
ClearErrors
IfErrors 0 GoError
CompareDLLVersions /STOREFROM "c:\winnt\system32\l3codecx.ax" "$SYSDIR\l3codecx.ax" docopy none

DetailPrint "Files are the same"
goto none

docopy:
; Put file there
File "c:\winnt\system32\l3codecx.ax"
REGDLL "$SYSDIR\l3codecx.ax"
DetailPrint "Installing.."
goto end
GoError:
DetailPrint "Error.."
none:
DetailPrint "Skip.."
end:
SectionEnd ; end the sectionSectionEnd
moshem is offline   Reply With Quote
Old 8th May 2001, 08:31   #2
moshem
Junior Member
 
Join Date: May 2001
Posts: 4
can anyone comment ?


can anyone tell me why NSIS have a sharing violation problem while other installers don't , how to get over it ?

thanks
moshem is offline   Reply With Quote
Old 8th May 2001, 19:33   #3
Koen van de Sande
Senior Member
 
Join Date: Mar 2001
Location: Holland
Posts: 269
Windows tends to keep files open. I had an application which showed which files are used by Windows, and these Multimedia conversion codecs are opened most of the time by Windows.
Maybe this is something worth checking out.

Koen van de Sande
Van de Sande Productions
TibEd.net | VPatch
Koen van de Sande is offline   Reply With Quote
Old 8th May 2001, 19:53   #4
moshem
Junior Member
 
Join Date: May 2001
Posts: 4
you are right


even after mediaplayer shutdown , explorer is still keeping these codecs open.

the wierd thing is that all other installation software can bypass this problem, NSIS can't.

who can check it ?
moshem is offline   Reply With Quote
Old 8th May 2001, 20:39   #5
justin
Moderator Alumni
 
Join Date: Apr 2000
Location: USA
Posts: 315
Extract the file to a temporary directory, and use
Rename /REBOOTOK $TEMP\myFile.ax $SYSDIR\whatever.ax

That way the file will be updated on reboot (likely the way that other installers do it)..

Also, at leaast on win2k, you may be able to do:

Rename $SYSDIR\whatever.ax $SYSDIR\whatever.old.ax

and then extract your file over it...

-Justin
justin is offline   Reply With Quote
Old 8th May 2001, 20:50   #6
moshem
Junior Member
 
Join Date: May 2001
Posts: 4
well..

Hi Justin,

thanks for your help

I tried that trick on win2k and strangly it worked, why is that ? and why would it work on other windows versions.

I tried NSIS &InstallWizard , I tracked them both using sysinternals filemon,

the flow was the same until NSIS got kicked by the OS for sharing violation and installwizard did not , there was no rebook neccecary.

maybe we are missing something here ?
moshem is offline   Reply With Quote
Reply
Go Back   Winamp 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