Archive: A better tutorial for extract, install, delete


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


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


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.


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


what do you mean by /sms is it a valid codec or you trying to say to add others please further elaborate


/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.


then how do I deal with completely deleting my files after installation that are extracted to my temp


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


1. initpluginsdir
2. file /oname=$PLUGINSDIR\myfile.exe 'myfile.exe'

3. READ THE MANUAL :-)



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


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


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.


Read the manual, here is the answer:
Appendix B: DLL/TLB Library Setup


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 ???


Depends what InstallShield version installer it is.

So does
ExecWait `"$INSTDIR\setup.exe" /sms`
not wait?

-Stu


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