You are here

NSIS Script Help

9 posts / 0 new
Last post
Session
Offline
Last seen: 3 years 3 months ago
Joined: 2008-06-08 06:42
NSIS Script Help

Hi,
I have been working on a portable app for me and a few of my friends and I am having a bit of a problem. Part of my script copies a bunch of files and this rather slows down the loading. I was wondering whether there was any way of showing the splash screen and copying the files at the same time. If there is, could somebody please point me in the right direction.

Thanks,
Session

Simeon
Simeon's picture
Offline
Last seen: 9 years 11 months ago
DeveloperTranslator
Joined: 2006-09-25 15:15
I think

the way Johns Launchers do it is the fastest so if you do it the same way it should be ok. But if you copy many files it will be slower. Could you post the part of your script you're talking about?

"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate

Session
Offline
Last seen: 3 years 3 months ago
Joined: 2008-06-08 06:42
; DEAL WITH THE SPLASH
	; DEAL WITH THE SPLASH SCREEN
	File /oname=$PLUGINSDIR\splash.bmp "splash.bmp"
	advsplash::show 2500 400 0 -1 $PLUGINSDIR\splash
	Delete $PLUGINSDIR\splash.bmp

	; COPY SAVES AND CUSTOM GAMETYPES TO CORRECT LOCATION
	CopyFiles /SILENT $LOCALSAVES\*.* $SAVESDIR

	; EXEC PROGRAM
	ExecWait "$EXEDIR\App\haloce\haloce.exe"

The saves and custom gametypes are a few MB's so it takes a while to copy. They are not needed instantly though so it would be good if there was a way to start copying them and then go on to the next part.

haustin
Offline
Last seen: 13 years 1 month ago
Joined: 2007-09-19 17:59
Hmmm.

That's not the same problem as described in your OP. Smile

Out of curiosity, what are the values of $LOCALSAVES and $SAVESDIR? Is COPY actually needed or would MOVE suffice?

Finally, if you're certain it would be OK to run the program while the copy/move happens in the background, you could change the ExecWait to Exec and move it before the copy/move command. You'd need to add logic to wait for the program to finish, however. Several existing launchers do this with a loop, but wraithdu created a header file (ProcFunc.nsh) that has a handy ${Execute}/${ProcessWaitClose} pair of macros.

-hea

Session
Offline
Last seen: 3 years 3 months ago
Joined: 2008-06-08 06:42
.

$LOCALSAVES is $DOCUMENTS\My Games\Halo CE
$SAVESDIR is $EXEDIR\Data\saves

At least I think that is right. I do not have the code on me at the moment. What do you mean by MOVE and COPY? The only reason I used the CopyFiles command is because I couldn't find a better one.

digitxp
digitxp's picture
Offline
Last seen: 13 years 3 weeks ago
Joined: 2007-11-03 18:33
He meant the rename command.

Not only does it rename files, it moves files.
But it doesn't work across drives, so CopyFiles is the only way to go. Oh, and you'd have to delete all the stuff you copied if you want to make changes happen (they abort if they are already there.).

Insert original signature here with Greasemonkey Script.

haustin
Offline
Last seen: 13 years 1 month ago
Joined: 2007-09-19 17:59
Sure...

Just initiate the splash screen prior to the file copying.

If you change the timeout from 2000 (or whatever) to 999999, the splash will stay up ~indefinitely until you call newadvsplash::stop without the /WAIT argument.

-hea

wraithdu
Offline
Last seen: 11 years 3 months ago
Developer
Joined: 2007-06-27 20:22
You're correct, and this is

You're correct, and this is how the other PApps launchers work.

But he has to switch to NewAdvSplash first (he's using a different splash plugin at the moment judging by his above code).

Session
Offline
Last seen: 3 years 3 months ago
Joined: 2008-06-08 06:42
After changing from AdvSplash

After changing from AdvSplash to NewAdvSplash it is working much nicer. It looks much smoother due to the fact that the loading period is practically gone.

Thanks,
Session

Log in or register to post comments