Old 23rd December 2010, 16:05   #1
thek
Member
 
thek's Avatar
 
Join Date: Jun 2006
Location: Austria
Posts: 92
Cool Debugging Uninstaller

Hello guys

I have little problem with my app
I added functionality to the uninstaller to check if the application is running
code:
Function un.Leave_PageConfirm
Pop $0
Pop $1
${do}
retry1:
retry2:
!insertmacro un.FindProcess "AVLDrive.exe" $0
${if} $0 <> 0
MessageBox MB_RETRYCANCEL|MB_ICONSTOP "$(UN.TEXT_DRIVE_RUNNING)" IDRETRY retry1
Abort
${endif}
!insertmacro un.FindProcess "Reportgenerator.exe" $0
${if} $0 <> 0
MessageBox MB_RETRYCANCEL|MB_ICONSTOP "$(UN.TEXT_RG_RUNNING)" IDRETRY retry2
Abort
${endif}
${LoopWhile} 0 <> $0
Push $1
Push $0
FunctionEnd


It works, but if you press cancel on the messagebox and then cancel on the uninstaller i get the error
Installer corrupted: invalid opcode
If I put everythin in a tiny testinstaller (see attachment) it works, but not in my big app

How can I find the error?
Or even better: Does somebody have a clue what I'm doing wrong?
Attached Files
File Type: zip example1.zip (2.0 KB, 122 views)
thek is offline   Reply With Quote
Old 23rd December 2010, 16:46   #2
blh83
Junior Member
 
Join Date: Aug 2010
Posts: 29
I am going to take a total stab in the dark here and am probably wrong, but it may be a stack corruption issue. Between your two files provided in the example.zip, there is a lot of stack manipulation.

In your function "un.Leave_PageConfirm" if the user chooses "cancel" you Abort. However, you haven't restored the stack by calling Push $1 and Push $0 before the Abort happens. Maybe by simply restoring the stack before aborting, your error will go away. Again, this is a stab in the dark and may be completely off (I am by no means an expert at this), so feel free to roll your eyes and disregard . It just seems suspicious that this happens only when the user cancels (hence the abort).
blh83 is offline   Reply With Quote
Old 23rd December 2010, 17:30   #3
thek
Member
 
thek's Avatar
 
Join Date: Jun 2006
Location: Austria
Posts: 92
thanks for the tip

i'm going to try it after the holidays.....
thek is offline   Reply With Quote
Old 23rd December 2010, 18:07   #4
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
You probably want to push at the beginning, then pop when you're done.
MSG is offline   Reply With Quote
Old 27th December 2010, 09:03   #5
thek
Member
 
thek's Avatar
 
Join Date: Jun 2006
Location: Austria
Posts: 92
Talking

Quote:
Originally Posted by MSG View Post
You probably want to push at the beginning, then pop when you're done.
This was exactly the problem!
Thanks for the tipp!
thek is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Tags
findprocess, uninstaller

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump