![]() |
#1 |
Junior Member
Join Date: Sep 2010
Posts: 6
|
Completely disable cancel
For a one type of install, once it gets past a certain point in the pages, I want to prevent the user from canceling. They need to finish the install and then do an uninstall if they want to change something.
I know there are a number of ways of doing this, like using the onUserAbort function, or getting the window handle of the Cancel button and disabling it, etc.. But, I'd like to have the appearance that the MUI_PAGE_INSTFILES and MUI_UNPAGE_INSTFILES in MUI 2 have where the Cancel button, the title bar Close button and the System Menu Close item are all disabled. However, the Next and Back buttons should be enabled. I've been searching, but I can't seem to find how that is done. Is there a simple way of doing this? Or, do I have to write a custom Show function for every standard page and disable everything manually? Thanks. |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Note that NSIS will disable/re-enable both when you enter/leave the InstFiles page.code: Stu |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Sep 2010
Posts: 6
|
Okay, thanks. That works, I found some similar code. And, I just created a function that I call on each page I need to use it.
Even after I read the doc, I don't quit understand this: ; Disable Close (X) button. System::Call user32::GetSystemMenu(i$HWNDPARENT,i0)i.R0 System::Call user32::EnableMenuItem(iR0,i${SC_CLOSE},i${MF_GRAYED}) I understand Windows programming and mostly the above makes sense. What I don't understand is the: i.R0 I know that is where the result of GetSystemMenu goes, as an int, but what is the dot? The '.' And why don't you use $R0? Same thing in the call to EnableMenuItem() There is iR0. Don't you need a space after the i? And, again, why isn't $R0 used instead of just R0? The reason I ask, is that when I copy some of these System::Call examples, they work. But when I try to write my own code it fails. ;-( |
![]() |
![]() |
![]() |
#4 | ||
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
Quote:
<type><inval/var><outvar> In this case, as you want the output from the function, there is no input value/variable, so the . (dot) is used to indicate such. Otherwise, if you wrote "iR0", the System plugin would think you're trying to input the value of $R0.. which makes no sense in this case. The System docs state it as follows: "Either one of source or destination can also be a dot ('.') if it is not needed." Because you're indicating to the System plugin that it should store the result of the function in the -variable- $R0. If you wrote that as i$R0, you'd be telling it to store the result of the function in whatever the -value- of $R0 is. I'm pretty sure that doesn't even work ![]() In that case, he could have used i$R0 (or 'i $R0', see below), as it's an input value. Matter of personal preference, perhaps ![]() Nope - System pretty much ignores that space after the parameter type. It can be easier to read when you do use the space, though. There is even a whole 'nother syntax form you can use.. I hardly ever see it used these days, though, so probably best to stay away from it. Here's an example using it, just for reference... look for the System::Call lines. http://nsis.sourceforge.net/Windows_...Mass_Installer Quote:
![]() |
||
![]() |
![]() |
![]() |
#5 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
I tend not to use spaces in my System plug-in calls when possible so that I do not have to use quotes. As soon as you introduce a space you must use quotes.
Stu |
![]() |
![]() |
![]() |
#6 | |
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
Quote:
i.e. PHP Code:
|
|
![]() |
![]() |
![]() |
#7 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
In NSIS you only need quotes to make a string with spaces a single token. If there are no spaces then you don't need quotes. In my two System calls there are no spaces and therefore I do not need any quotes. I guess thinking about it it's just to stop the syntax highlighter in Notepad2 picking up my System code as just another string in quotes.
Stu |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|