Archive: What about this NSIS installer script - possible or not?


What about this NSIS installer script - possible or not?
Hello everyone,

I want to create an NSIS script and I need your help:

I have next files:

file1.exe
file2.exe
file3.dll
file4.dll
file5.dat
file6.dat

and I want all files to be added to an installer with the next options:

The installer should extract all files to temp folder, then the file "file1.exe" should start, then the files should be copied/moved to the Windows/system32 folder and deleted from temp folder, then file2.exe should start.

I use the next NSIS script to create an installer that extract the files on Windows temp folder and then run file1.exe but don't know how to update it to copy/move the files to Windows\system32 folder and then run file2.exe

Here is the script so please any help to update it or give me a new solution will be highly appreciated. Here is the script:



OutFile "installer.exe"
Icon "name.ico"
SilentInstall Silent
WindowIcon Off
CRCCheck On
SetCompress Off
RequestExecutionLevel highest

Section

; Generate a temp file name
GetTempFileName $0
; Delete it and replace it with a folder
Delete $0
CreateDirectory $0

; Report any problem
IFErrors 0 +2
Abort "Can't install application! Please contact support."

; Unpack files
SetOutPath $0

; Pack all the files in the current directory and its subdirectories,
; excluding anything in SVN
; File /r /x .svn "*.*"
File /r /x .svn /x *.ico /x *.nsi "*.*" ; Also exclude the ICO and NSI files from installer

; Run the executable and wait
ClearErrors
SetOutPath "$0\"

; IMPORTANT: Place the name of your starting executable (i.e. the file to run
; when unpacked) here.
ExecWait "$0\file1.exe"

IFErrors 0 +2
Abort "Can't run app! Please contact support."

; And delete the unpacked files
ClearErrors
SetOutPath $TEMP ; Need to do this because we can't delete the working folder
RMDir /r $0 ; If there's an error we probably don't really care, as it's in a temp folder

SectionEnd





Thank you in advance for your help.
If anyone can offer me real support then I can pay him for the time spent for me!

Thanks!


Unpack your files in $PLUGINSDIR which is removed upon terminating the installer. (see the manual)

ExecWait or nsExec the file1.exe (see the manual again)

Once the file1.exe has finished CopyFiles or Rename from the $PLUGINSDIR to $SYSDIR (once again see the manual)

Finally launch file2.exe with Exec or ExecWait or nsExec if you're dealing with console applications.

What else? Read the documentation.


Red Wine, thank you so much for your reply!

I am just beginner with NSIS and I need someone to update my script (or post a new one) for my case.

As I said before, if anyone can offer me professional support and help me with what I need, I can pay with PayPal for that, just let me know!

If anyone can update my script or create a new one for my case please let me know.

Thank you!


Nevertheless, you'll need to provide more details about the task.


Red Wine, thank you again for your reply!

I will try to give you more info as requested:

I will rename the files to make you understand much better what I need:

uninstall.exe
uninstall.dat
installer.exe
installer.dll
installer.dat

Now I need an installer with all the above files inside and the installer should unpack the files on Windows TEMP folder, then next run the uninstall.exe file (this will uninstall any previous installed version of the application which is installed on Windows system32 folder) then once any old version is uninstalled the installer files (installer.exe, installer.dll, installer.dat) should be copied/moved to Windows system32 folder and the file installer.exe should be executed. After this is completed the temp files should be deleted.

Also next options should be there:

SilentInstall Silent ; for Silent install
RequestExecutionLevel highest ; for Vista
CRCCheck On ; I think is needed
SetCompress Off ; I think is needed for faster extraction

If you need more info please let me know and if you spend your time to help me I don't want you to do it for nothing, I want to pay you for that and maybe we can continue future collaboration.

Thanks!


Okay, do you want to upload the files somewhere and give the link to download them and build your installation or you prefer a script on which you'll replace the file names and the local paths in order to compile it your self?


Red Wine, thank you!

I prefer a script on which I will replace the file names and the local paths in order to compile it my self.

In the script I post it I should have the files in one folder and the script will add all the files inside the folder to installer excepting the .svn , .nsi and .ico files which not needed on the installer. I preffer same way when I create the installer but only if is possible.

Thanks!