- NSIS Discussion
- Running a file that is packed in the installer
Archive: Running a file that is packed in the installer
treaz
9th January 2003 20:30 UTC
Running a file that is packed in the installer
Please let me know if this is possible:
During installation, I wish to get inputs from the user and pass these inputs to a file (packed within the installer - meaning to say this is a file which has been compiled within the installer and would be copied to the target machine after validation) for validation.
The validation process would require the execution of an external/3rd party application (which can be assumed to exist on the target machine).
Does anyone have any idea if this can be done and How can it be done?
Thanks.
kichik
9th January 2003 20:47 UTC
Use Exec, ExecWait, ExecShell or nsExec (a plug-in). I would recommend making that executable a plug-in if it's for validation only, will be faster.
treaz
9th January 2003 21:51 UTC
Hi, I reckon the use of Exec is feasible however, may I know how do it refer to the file that is packed within the installer? As it has yet to be copied into the target machine, $INSTDIR won't work, would it?
As of now I am still not able to make the file into an executable plugin, so I believe I do not have it as an option yet.
Thanks.
kichik
9th January 2003 22:09 UTC
Extract it to $PLUGINSDIR (initialize it first using InitPluginsDir), and execute it from there. It will be automatically deleted when the installer finishes.
treaz
10th January 2003 21:28 UTC
I guess this may be a stupid question, but may I know how do I extract a particular file to the PLUGINSDIR?
Thanks.:o
Sunjammer
10th January 2003 21:42 UTC
SetOutPath $PLUGINSDIR
File thefilename.exe
or this may even work...
File /oname="$PLUGINSDIR/thefilename.exe" thefilename.exe
I don't have time to check these but you get the general idea. The File command both includes a file AND extracts it, it has a different meaning to makensis than when it is running in the compiled installer.
kichik
10th January 2003 22:30 UTC
Should be:
File "/oname=$PLUGINSDIR/thefilename.exe" thefilename.exe
SetOutPath works too.
Just don't forget to use InitPluginsDir first.
treaz
10th January 2003 23:16 UTC
Hi,
Thanks for the response.
However, it seems like only SetOutPath works for me.
File "/oname=$PLUGINSDIR/thefilename.exe" thefilename.exe
doesn't work.
But since something works.I am fine. Thanks. :)
kichik
10th January 2003 23:29 UTC
Like I said:
Should be:
File "/oname=$PLUGINSDIR\thefilename.exe" thefilename.exe
treaz
10th January 2003 23:35 UTC
Hi,
Both ways (\ slash or / slash) didnt work.
But its fine using SetOutPath.
Thanks.
kichik
10th January 2003 23:49 UTC
It's not only the \ it's the quote around the entire thing not just the $PLUGINSDIR\filename.exe.