Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 13th October 2010, 11:17   #1
Pravin
Junior Member
 
Join Date: Oct 2010
Location: INDIA
Posts: 37
ExecWait issue

Im new to NSIS and following is my issue.

Im having two different path directory for client and server so im using custom variables to save the path instead of $INSTDIR.

while installation im checking whether any previous version exists and if exists im calling uninstaller to uninstall using ExecWait as follows.

ExecWait '$G4 _?=$INSTDIR'


Steps :
-------

1.exe executed.
2.prev version found.
3.uninstaller is triggered.
4.installer is disabled and uninstaller is active.
5.i shifted my focus to installer and clicked "NEXT" . Result : NO change in the installer since it is disabled.
6.i proceeded with uninstallation.
7.After Uninstallation , Installer becomes active.
8.I found installer has skipped one page since i clicked "NEXT" when it was disabled.



why does the page is being skipped? How to avoid it??

I tried searching for this issue in forum but couldnt find. if the issue is addressed already let me know the link. else please help me to find a solution. Thanks in advance.
Pravin is offline   Reply With Quote
Old 13th October 2010, 12:08   #2
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,164
Send a message via ICQ to Yathosho
not sure why this is happening, but you could disable the next button for the time the uninstaller is active.

you can actually copy&paste the first two lines of given example.. (next=1, cancel=2, back=3)
Yathosho is offline   Reply With Quote
Old 13th October 2010, 13:13   #3
Pravin
Junior Member
 
Join Date: Oct 2010
Location: INDIA
Posts: 37
Thanks for the response. im not able to understand which example your are talking about. could u give me the sample code to disable the next button. thanks once again.
Pravin is offline   Reply With Quote
Old 13th October 2010, 14:02   #4
vankaa
Junior Member
 
Join Date: Sep 2010
Posts: 5
Click his "disable" and you can read what you need.

GetDlgItem $0 $HWNDPARENT 1 <---- 1-next
EnableWindow $0 0
vankaa is offline   Reply With Quote
Old 13th October 2010, 17:00   #5
Pravin
Junior Member
 
Join Date: Oct 2010
Location: INDIA
Posts: 37
thanks Yathosho and Vankaa for the respose.

The code disabled NEXT button. but still if i click on it, after uninstallation once it enters back to the installation i find it skips pages according to total number of clicks on NEXT (disabled) button.

some one do me a favour. using MUI create a sample nsi in which u call another installer and try clicking on the NEXT button when the installer is not in active mode and let me know whether u too face the same issue. Thanks in advance
Pravin is offline   Reply With Quote
Old 13th October 2010, 17:09   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
Please submit a bug report. For now, try using a Banner (see NSIS\Docs). You could also try putting some Sleep statements after as well.

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 14th October 2010, 12:32   #7
Netsurfer24
Senior Member
 
Join Date: Aug 2010
Posts: 104
Quote:
Originally Posted by Afrow UK View Post
Please submit a bug report.
I don't think that it is a bug. I guess it has more to do with the fact that the mouse clicks are being "queued" during the ExecWait. And as the button is re-enabled afterwards the previous clicks are now being processed.

Quote:
Originally Posted by Pravin View Post
The code disabled NEXT button. but still if i click on it, after uninstallation once it enters back to the installation i find it skips pages according to total number of clicks on NEXT (disabled) button.
Yes, see above for the possible reason.

I am doing quite the same (uninstall previous version during install) as you do. IMO you have a fault in your concept. Calling the uninstaller directly from one of the installer pages is generally a bad idea. What if the user cancel the installation afterwards?

I added a separate topmost hidden section from where I call the uninstaller (if needed). You can control this e.g. by using
PHP Code:
SectionSetFlags ${<name_of_your_section>} ${SF_SELECTED
depending on a variable's value or whatever.


Good luck & success

Gunther
Netsurfer24 is offline   Reply With Quote
Old 14th October 2010, 12:38   #8
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
Quote:
Originally Posted by Netsurfer24 View Post
I don't think that it is a bug. I guess it has more to do with the fact that the mouse clicks are being "queued" during the ExecWait. And as the button is re-enabled afterwards the previous clicks are now being processed.
Yes that much is pretty obvious. I'd still regard this as a bug though because it is unexpected/undocumented behaviour.

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 14th October 2010, 12:43   #9
Netsurfer24
Senior Member
 
Join Date: Aug 2010
Posts: 104
Quote:
Originally Posted by Afrow UK View Post
I'd still regard this as a bug though because it is unexpected/undocumented behaviour.
Sorry, but I disagree. This is pretty much the normal Windows behaviour. It has nothing to do with NSIS.
If you want to change it you have to "manipulate" the mouse handling of Windows. But as I suggested, IMHO there is no need for this.

Gunther
Netsurfer24 is offline   Reply With Quote
Old 14th October 2010, 12:53   #10
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
This is not default Windows behaviour. I'm not sure how you got that idea. It will occur if you block the message thread for a window. In NSIS's case it still processes WM_PAINT but does not process anything else. It could be modified to process other window messages (thus eat them up) but not take any action.

Edit: However I definitely agree that use of ExecWait outside a section for long processes (and especially uninstallers) is definitely not a good idea.

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 14th October 2010, 13:06   #11
Pravin
Junior Member
 
Join Date: Oct 2010
Location: INDIA
Posts: 37
Thanks Afro and Netsurfer for your suggestion. Thanks once again Afro for your active participation in the forum and for immediate response on the issues.

1. Just to confirm it is a BUG i asked others to check whether they too face the same issue
Do you face the same issue?? If yes , tell me the right procedure to report a BUG.

2. As discussed above that usage of ExecWait outside long processes is not good idea.
I'll make a note of it.

I have a situation where user need to uninstall the previous version before proceeding. I'll try to edit the current scenario.
Pravin is offline   Reply With Quote
Old 14th October 2010, 13:09   #12
Pravin
Junior Member
 
Join Date: Oct 2010
Location: INDIA
Posts: 37
Netsurfer i'll try to make utilize of the concept and the code given by you.Thanks.

Quote:
SectionSetFlags ${<name_of_your_section>} ${SF_SELECTED}
Pravin is offline   Reply With Quote
Old 14th October 2010, 13:27   #13
Netsurfer24
Senior Member
 
Join Date: Aug 2010
Posts: 104
Stu,
Quote:
Originally Posted by Afrow UK View Post
This is not default Windows behaviour. I'm not sure how you got that idea. It will occur if you block the message thread for a window. In NSIS's case it still processes WM_PAINT but does not process anything else. It could be modified to process other window messages (thus eat them up) but not take any action.
Hmmm ..., I thought it is the WM_NOTIFY Message which is responsible for the mouse clicks and as it is not disabled cause you disable a button in window ...
But I am pretty shure that you have a much deeper knowledge of these things than I have - so if you it is a bug then it is bug.


Quote:
Originally Posted by Pravin View Post
I have a situation where user need to uninstall the previous version before proceeding. I'll try to edit the current scenario.
And the user may cancel/ abort the installation after this? What happened then - the user ends up with no installation at all? The previous one already uninstalled and the new one not installed?

At another place in my installer I solved this issue (don't want the user to click around) by hiding the whole installer window and only showing a banner during the process. Maybe this works for you, too?

Gunther
Netsurfer24 is offline   Reply With Quote
Old 14th October 2010, 13:47   #14
Pravin
Junior Member
 
Join Date: Oct 2010
Location: INDIA
Posts: 37
Quote:
And the user may cancel/ abort the installation after this? What happened then - the user ends up with no installation at all? The previous one already uninstalled and the new one not installed?
By Netsurfer24

In uninstaller section i have a message box which will ask for the confirmation.
so only after confirmation it ll proceed to uninstall.

After that i check my registry

PHP Code:
ReadRegStr $G4 ${PRODUCT_UNINST_ROOT_KEY"${PRODUCT_UNINST_KEY}" "UninstallString"
${if} $G4 != ''" 
if the registry is not null i assume it has not uninstalled and i call the same page by a goto condition to start of the page.

I know there must be some better way to call the page again like
PHP Code:
 Call RelGotoPage 
. Im working on it
Pravin is offline   Reply With Quote
Old 14th October 2010, 13:49   #15
Pravin
Junior Member
 
Join Date: Oct 2010
Location: INDIA
Posts: 37
I have two radio button on the page

1.Add/Reinstall ( which will uninstall and proceed with installation )
2.Uninstall ( does only uninstallation )
Pravin is offline   Reply With Quote
Old 15th October 2010, 07:29   #16
Pravin
Junior Member
 
Join Date: Oct 2010
Location: INDIA
Posts: 37
Bug raised .Artifact ID: 3087924
Pravin is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

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