Archive: Proofread, fix and streamline


Proofread, fix and streamline
i need your help guys, i am trying to streal line, structure and otherwise clean up some of my script code and i need your help.

One thing that i realli need help with is that add/remove freezes after i uninstall using the add/remove panel since i use 'exec' to execute a file.
It becomes normal once i close the prog. o please that is something i realli need help with. The rest i would like fo ur guys to help me clean up. thanks ipab


anyone :s, plz i realli need assistance


Use ExecWait if you want to run something in the background.


that only waits for and and thus it doesnt exit the installer, i want the installer to exit as soon as it finishes launching msn messenger


This code is logically wrong:
loop:
KillProcDLL::KillProc "msnmsgr.exe"
IntCmp $R0 603 exit
Goto loop
exit:

Here you're only exiting (jumping to exit) if msnmsgr.exe could not be terminated. Read the KillProcDLL readme. KillProcDLL returns 0 if the process was successfully terminated and 603 if it wasn't.

On another note, using KillProcDLL is a bad (and last resort) way to kill programs. You should either close them by sending WM_CLOSE with SendMessage, or prompt the user to close it manually:


FindWindow $R0 "" "MSN Messenger"
IsWindow $R0 0 +3
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "Please close MSN Messenger before continuing!" IDRETRY -2
Abort


-Stu

loop:
KillProcDLL::KillProc "msnmsgr.exe"
IntCmp $R0 603 exit
Goto loop
exit:

i want it that way, since there are several processes named msnmsgr.exe and thus i want to kill all of them


Yes but take a look and follow the code through:

Begin loop
Attempt to kill msnmsgr.exe
If failed exit
Else loop

I think what you want is:

Begin loop
Attempt to kill msnmsgr.exe
If failed loop
Else exit

-Stu


Simplified:

loop:
KillProcDLL::KillProc "msnmsgr.exe"
IntCmp $R0 0 loop

-Stu


installer
here is an installer made with your improved kill code.

can u please take a look at the uninstaller part (install using the installer)and then uninstall using add/remove programs. I think that you will more clearly understand my dilemma.

http://www.mad-skinning.net/skins/?page=mad


please delete this, it was by accident.