- NSIS Discussion
- A better tutorial for extract, install, delete
Archive: A better tutorial for extract, install, delete
rxs2k5
15th April 2006 07:12 UTC
A better tutorial for extract, install, delete
hi pros,
I am trying to understand most of the stuff provided in here but then I just cannot get it as many of it are refering to different things
Here's my questions, will it be possible to provide a tutorial
1. I have an installer.exe
2. I have a file.exe
3. I have a registry.reg file
How to make
1. Create an installer.exe which will extract it to temp
2. During installation, installer.exe will run and file.exe will run.
3. When installation completes, registry.reg in temp folder will register.
4. Whatever is left in the temp folder will be completely deleted without a single trance, after the finish page.
thanks
Afrow UK
15th April 2006 11:29 UTC
Like all of us have done, you should read the documentation provided. It has everything you need. You just need to use a bit more brain power and work out how to do it.
-Stu
rxs2k5
15th April 2006 11:39 UTC
Hi Afrow UK
1.
I actually found something for the .exe extracting but then in this topic here
Will this ever happens ? How will I solve it ?
2.
How can I make a registry.reg to enter into the user registry sliently ?? (codes)
thanks for your reply is appreciated.
Afrow UK
15th April 2006 12:20 UTC
1. If ExecWait doesn't wait then that'd mean the installer being executed passes execution onto another process and then quits. In other words, you need to pass it an extra parameter (say /sms for example) to make it wait.
2. Either execute regedit to do it with the registry.reg file path as the parameter (which will bring up a confirmation message box), or translate the registry.reg file into WriteRegStr instructions.
-Stu
rxs2k5
15th April 2006 15:05 UTC
what do you mean by /sms is it a valid codec or you trying to say to add others please further elaborate
Red Wine
15th April 2006 15:12 UTC
/sms is a switch used in (older) IShield installations. if you try to execute one of those IShield installations from cmd without /sms you end up with nothing.
rxs2k5
15th April 2006 16:35 UTC
then how do I deal with completely deleting my files after installation that are extracted to my temp
rxs2k5
15th April 2006 18:40 UTC
hi pros
I done everything is fine but I have some questions here.
1.Why is it that I have some files, like installoptions.dll,modern-wizard,iospecial.ini in the temp folder during installation ???
1.1 Are they supposed to be there or not to be there ??
1.2 Is there a way to prevent these from appearing in temp ?? because I do want people to know the stuff I am using for the installer.
2. Please look at the section code
SetOutPath $TEMP
SetOverwrite on ( is there any other code beside SetOverwrite ?? Can you tell me in nsis help which page should I refer for more sections addable code.)
thanks
Red Wine
15th April 2006 19:14 UTC
1. initpluginsdir
2. file /oname=$PLUGINSDIR\myfile.exe 'myfile.exe'
3. READ THE MANUAL :-)
Red Wine
15th April 2006 19:49 UTC
function .onInit
# along with anything else you have to do on init
initpluginsdir
functionend
section -
# suppose you're ready to do the job
file /oname=$PLUGINSDIR\file1.exe "my local dir\file1.exe"
clearerrors # or use a return var to check for errors
execwait '$PLUGINSDIR\file1.exe'
iferrors # executions failed do something
# execution would fail also but without errors
# if the executed prog requires params e.g. /sms
file /oname=$PLUGINSDIR\file2.exe "my local dir\file2.exe"
clearerrors # or use a return var to check for errors
execwait '$PLUGINSDIR\file2.exe'
iferrors # executions failed do something
# execution would fail also but without errors
# if the executed prog requires params e.g. /sms
# this is not recommended, instead try to convert the registry
# entries to NSIS script. Search forum for a tool reg2nsis
# this tool could help you under some conditions, read readme.
file /oname=$PLUGINSDIR\registry.reg "my local dir\registry.reg"
clearerrors # or use a return var to check for errors
execwait 'regedit.exe /s $PLUGINSDIR\registry.reg'
iferrors # write to registry failed do something
sectionend
Function .onInstSuccess
# in case you did a convertion from registry.reg to nsh
!include 'registry.nsh'
functionend
rxs2k5
15th April 2006 20:08 UTC
Thanks alot redwine, I think its ok with the temp
thanks everyone for giving me a bit hints, manage to compile all the knowledge with full details supports. thanks again
rxs2k5
15th April 2006 20:22 UTC
hi
1 question
4.9.3.13 RegDLL
dllfile [entrypoint_name]
Loads the specified DLL and calls DllRegisterServer (or entrypoint_name if specified). The error flag is set if an error occurs (i.e. it can't load the DLL, initialize OLE, find the entry point, or the function returned anything other than ERROR_SUCCESS (=0)).
Use SetOutPath to set the current directory for DLLs that depend on other DLLs that are now in the path or in the Windows directory. For example, if foo.dll depends on bar.dll which is located in $INSTDIR use:
SetOutPath $INSTDIR
RegDLL $INSTDIR\foo.dll
Does this register, ocx and other system files ???
If NO, please verify which script code I should be using.
Red Wine
15th April 2006 22:08 UTC
Read the manual, here is the answer:
Appendix B: DLL/TLB Library Setup
rxs2k5
17th April 2006 14:16 UTC
hi pros
yes my greatest fear have arrived
both ExecWait doesn't wait
1. beside using /sms
Is there any other safe way to make it wait till it close and launch the next installer ???
Afrow UK
17th April 2006 15:01 UTC
Depends what InstallShield version installer it is.
So does
ExecWait `"$INSTDIR\setup.exe" /sms`
not wait?
-Stu
rxs2k5
17th April 2006 15:35 UTC
Afrow UK my computer is a bit weird
Now execwait obeys the installer,
both one of my installer made from innosetup, the other made from nsis.
Now it follows orders
like
extracting....1
extracting....2
execloading....1 ( freeze ) [when close]
execloading....2 (freeze) [when close]
delete 1
delete 2
Its like not a single trace to be found cool.
Thanks for your reply I have manage to solve the problem,
Thanks for your plugins
File:ScrollLicense.zip
File:PassDialog.zip