You are here

need nsis script

10 posts / 0 new
Last post
tipra.wicked
tipra.wicked's picture
Offline
Last seen: 13 years 9 months ago
Joined: 2007-08-31 05:27
need nsis script

could anyone help me
i need a nsis script which sets the system date to 5 feb 2008 (date only not the time) the executes a program then sets the system date back to the current date.

also could anyone guide me to a guide on advance features on nsis as i already know the basic and am already creating portable apps for myself.

thanks in advance

you could correspond with me through email (tipra [dot] wicked [at] gmail [dot] com) or could post in this forum itself
many thanks

John Bentley
John Bentley's picture
Offline
Last seen: 14 years 8 months ago
Developer
Joined: 2006-01-24 13:26
Take a look at this:

cowsay Moo
cowthink 'Dude, why are you staring at me.'

tipra.wicked
tipra.wicked's picture
Offline
Last seen: 13 years 9 months ago
Joined: 2007-08-31 05:27
thanks

thank you very much that software worked out perfectly but now the problem is i have to change the time in the software every time i launch it
so i think i would really like to have a nsis script

*edit*
sorry about that i just figured out how to do it using runasdate just read the help manual carefully thanks for your help
*edit*

tipra.wicked
tipra.wicked's picture
Offline
Last seen: 13 years 9 months ago
Joined: 2007-08-31 05:27
need more help

actually this is what my launcher does

1>it copies some files to My Documents
2>Runs the program thru runasdate.exe
3>to make it fully portable it should copy back the contents from documents to the pendrive so this is what i have written


CopyFiles /SILENT "$EXEDIR\Data\xyz" "$DOCUMENTS\xyz"
Sleep 100
ExecWait '"$EXEDIR\Manager\RunAsDate.exe" 05/02/2008 "$EXEDIR\Manager\xyz.exe"'
CopyFiles /SILENT "$DOCUMENTS\xyz" "$EXEDIR\Data\xyz"
Sleep 100
RMDir /r "$DOCUMENTS\xyz"

seeing my code it is supposed to be correct.
but the obvious flaw is that runasdate.exe is only there for a split second and then xyz.exe takes over.
therefore the files get deleted for my documents and my program(xyz.exe) cannot access those.
so what i want is that the launcher monitors xyz.exe in the task manager and execute the following code after i quit xyz.exe


CopyFiles /SILENT "$DOCUMENTS\xyz" "$EXEDIR\Data\xyz"
Sleep 100
RMDir /r "$DOCUMENTS\xyz"

John Bentley
John Bentley's picture
Offline
Last seen: 14 years 8 months ago
Developer
Joined: 2006-01-24 13:26
Look at the process

cowsay Moo
cowthink 'Dude, why are you staring at me.'

wraithdu
Offline
Last seen: 10 years 10 months ago
Developer
Joined: 2007-06-27 20:22
You'll have to use the

You'll have to use the FindProcDLL to test for the existence of xyz.exe in a loop -

CopyFiles /SILENT "$EXEDIR\Data\xyz" "$DOCUMENTS\xyz"
ExecWait '"$EXEDIR\Manager\RunAsDate.exe" 05/02/2008 "$EXEDIR\Manager\xyz.exe"'
FindEXE:
FindProcDLL::FindProc "xyz.exe"
     StrCmp $R0 "0" 0 EndEXE ; 0 = process exists
     Sleep 1000
     Goto FindEXE
EndEXE:
CopyFiles /SILENT "$DOCUMENTS\xyz" "$EXEDIR\Data\xyz"
RMDir /r "$DOCUMENTS\xyz"

You'll need the FindProc plugin for this to work.

tipra.wicked
tipra.wicked's picture
Offline
Last seen: 13 years 9 months ago
Joined: 2007-08-31 05:27
thanks

but


Invalid command: FindProcDLL::FindProc

Simeon
Simeon's picture
Offline
Last seen: 9 years 6 months ago
DeveloperTranslator
Joined: 2006-09-25 15:15
missing plugin

You need the NSIS FindProc plugin.

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

tipra.wicked
tipra.wicked's picture
Offline
Last seen: 13 years 9 months ago
Joined: 2007-08-31 05:27
thanks that worked

wraithdu
just change this

StrCmp $R0 "0" 0 EndEXE ; 0 = process exists

to

StrCmp $R0 "0" EndEXE 0 ; 0 = process exists

then it worked

wraithdu
Offline
Last seen: 10 years 10 months ago
Developer
Joined: 2007-06-27 20:22
My bad, I got confused with

My bad, I got confused with another plugin.

0 = process does NOT exist
1 = process exists

Log in or register to post comments