deathwish2
10th June 2005 15:21 UTC
Not all files being included/.extracted
Greetings,
In my script I use the "File" command 8 times and during compilation it indicates that it has included them and displays the compression values. When I run the program, although it says that they have been extracted only 6 actually get extracted. I can't figure out why this would be. Any ideas?
Thanks
Afrow UK
10th June 2005 15:40 UTC
Yes, attach your script :p
-Stu
deathwish2
10th June 2005 16:40 UTC
I have a little more info, since I was testing more...
(BTW v2.06)
If one does the following:
;Download area for most up to date files
StrCpy $DOWNLOAD_URL "http://some_url/"
;Most up to date file at compilation
File "test.txt"
;Download the newest version if possible (i.e. net available)
StrCpy $DOWNLOAD_FILENAME "test.txt"
NSISdl::download_quiet $DOWNLOAD_URL$DOWNLOAD_FILENAME $TEMP\$DOWNLOAD_FILENAME
Pop $R0
StrCmp $R0 "success" +2 +1
Detail Print "Download of test.txt failed - using local copy."
.
.
.
When the network isn't available (which is likely for the intentions of this app) what happens is that the "download" directive seems to delete the file test.txt in the destination directory. So falling back to the "local" copy fails unless I do:
StrCmp $R0 "success" +3 +1
Detail Print "Download of test.txt failed - using local copy."
File "test.txt"
.
.
.
Which to me is just an UGLY hack.
Any suggestions on cleaner code?
Thx.
Afrow UK
10th June 2005 16:48 UTC
Don't use variables for strings if they aren't going to change dynamically. This wastes memory very much!
!define DownloadURL "http://some_url/"
!define DownloadFile "test.txt"
NSISdl::download_quiet "${DownloadURL}${DownloadFile}" "$TEMP\${DownloadFile}"
Pop $R0
StrCmp $R0 "success" noDownloadFile
DetailPrint "Download of test.txt failed - using local copy."
SetOutPath $TEMP
File "test.txt"
noDownloadFile:
-Stu
deathwish2
10th June 2005 17:08 UTC
Thx,
I'm going to have to change quite a bit of my code (I only gave an example snippet). Nonetheless... I see where I have to go. Also thanks for the info on the variables/memory... but they will be changing through the script so...:up: