Archive: Going Crazy!!! Please Help!


Going Crazy!!! Please Help!
I have been in the NSIS irc channel for 2 days, not a peep, I think everyone there is dead.


I have a variable, an integer, it has 3 possible values, "-1", "0" and "1".
In the function, .onInit I set it to -1.
I check for 2 different radio buttons to be selected and set it to 0 or 1 depending on which was selected.

I want to be sure I catch all possible things, I hate un-expected errors. So I am attempting to make sure that it isn't selected at all. This works great !!!

HOWEVER if nothing is selected (neither radio button) and I click the cancel aka close button while on this page, I get stuck in a stupid loop. It doesn't close the app, it "Please select an option." and then doesn't close, it calls Reset.

How do I get around this????

PLEASE someone help, I've been banging my head against this for 6 hours. (though I made allot of progress)



Function PAGE_ioInstallType ;FunctionName defined with Page command

IntOp $install_type 0 - 1
Reset:
!insertmacro MUI_HEADER_TEXT "Install Type" "Please select one of the folowing before continuing."
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioInstallType.ini"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioInstallType.ini" "Field 1" "Text" "Default (Curent User)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioInstallType.ini" "Field 2" "Text" "Advanced (--nohomedir)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioInstallType.ini" "Field 3" "Text" "This is the standard Jailbreak installation."
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioInstallType.ini" "Field 4" "Text" "For users that have specified '--nohomedir' for their game. Only recommended for experienced users."
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioInstallType.ini" "Field 5" "Text" "Choose the type of installation you prefer, then click Next."
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioInstallType.ini"
;--------------------------------------------------------------------------------------------------------------------
!insertmacro INSTALLOPTIONS_READ $R0 "ioInstallType.ini" "Field 1" "State"
IntCmp $R0 1 do_STANDARD_INSTALL
;--------------------------------------------------------------------------------------------------------------------
!insertmacro INSTALLOPTIONS_READ $R0 "ioInstallType.ini" "Field 2" "State"
IntCmp $R0 1 do_CUSTOM_INSTALL
;--------------------------------------------------------------------------------------------------------------------
IntCmp $install_type -1 StartReset

StartReset:
MessageBox MB_OK|MB_ICONEXCLAMATION "Please select an option."
Goto Reset

do_STANDARD_INSTALL:
IntOp $install_type 0 + 0
Abort
do_CUSTOM_INSTALL:
IntOp $install_type 0 + 1
Abort
FunctionEnd


Well, thanks to wikipedia: here is the solution I came up with.



Page custom showInstallOptionsPage LeaveFunc

Function LeaveFunc
;--------------------------------------------------------------------------------------------------------------------
!insertmacro INSTALLOPTIONS_READ $R0 "ioInstallType.ini" "Field 1" "State"
IntCmp $R0 1 do_STANDARD_INSTALL
;--------------------------------------------------------------------------------------------------------------------
!insertmacro INSTALLOPTIONS_READ $R0 "ioInstallType.ini" "Field 2" "State"
IntCmp $R0 1 do_CUSTOM_INSTALL
;--------------------------------------------------------------------------------------------------------------------
Goto Last
do_STANDARD_INSTALL:
IntOp $install_type 0 + 0
Goto End
do_CUSTOM_INSTALL:
IntOp $install_type 0 + 1
Goto End
Last:
IntOp $install_type 0 - 1
MessageBox MB_OK|MB_ICONEXCLAMATION "Please select an option"
Abort
End:

FunctionEnd

Function showInstallOptionsPage ;FunctionName defined with Page command

IntOp $install_type 0 - 1
!insertmacro MUI_HEADER_TEXT "Install Type" "Please select one of the folowing before continuing."
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioInstallType.ini"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioInstallType.ini" "Field 1" "Text" "Default (Curent User)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioInstallType.ini" "Field 2" "Text" "Advanced (--nohomedir)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioInstallType.ini" "Field 3" "Text" "This is the standard Jailbreak installation."
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioInstallType.ini" "Field 4" "Text" "For users that have specified '--nohomedir' for their game. Only recommended for experienced users."
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioInstallType.ini" "Field 5" "Text" "Choose the type of installation you prefer, then click Next."
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioInstallType.ini"

FunctionEnd



I'm in the IRC channel every day, and I know I have said something in the past 2 days, so not a peep is not true, but yes, it normally is pretty quiet there (Your best bet is to ask around 16:00-00:00 UTC)


Originally posted by Anders
I'm in the IRC channel every day, and I know I have said something in the past 2 days, so not a peep is not true, but yes, it normally is pretty quiet there (Your best bet is to ask around 16:00-00:00 UTC)
Not to argue, but look:
Conversation with #nsis on 8/28/2008 1:13:47 AM:
(12:13:47 AM) #nsis: The topic for #nsis is: 2.39 | http://nsis.sf.net/ | http://*******.com/nsis-forum | Test your brain in #trivia
(12:53:33 AM) Pendragon: Hello?
(12:53:58 AM) #nsis: You're not channel operator

---

Conversation with #nsis on 8/20/20091:13:47 AM:
(20:26:04) The topic for #nsis is: 2.45 | http://nsis.sf.net/ | http://sn.im/nsis-forum
(20:27:50) Pendragon: I am having a problem with the startmenu default folder in the ModernUI startmenu, it appears the NAME set at the top of the file, is the default folder name, I want to use a different folder name, but can't figure out how to set it, I've made a function called setStartMenu and did a StrCpy "$StartMenuFolder "mycompany.com"" inside of it, then called it before the startment section, but no luck
(21:36:14) Pendragon: ah I figured it out
(21:40:09) Pendragon: HELOOOOOOO!
(21:40:12) Pendragon: oops sorry
(21:40:23) Pendragon: key got stuck, and I didn't know caps was on,
(21:40:31) Pendragon: I ment, "hello?"
(2009-08-21 00:07:29) Pendragon: Hello?
(00:07:45) Pendragon: wow, 24 hours of silence
(00:45:32) __gints__ [~gints@62.84.15.211] entered the room.
(00:47:35) _gints___ left the room (quit: Ping timeout: 248 seconds).
(03:16:37) lithium [~joerg@194.25.104.19] entered the room.
(03:45:05) Pendragon: Anyone awake?
(03:46:19) Pendragon: I've got a single loop on http://nsis.pastebin.com/m2046faef If the user presses Close , and nothing is selected (no radio buttons) the program doesn't exit.
(04:15:32) NekoMSG [Message@wlan143094.mobiel.utwente.nl] entered the room.
(06:21:09) kichik [~someone@85-250-188-9.bb.netvision.net.il] entered the room.
(06:21:12) mode (+o kichik) by Beefcake
(06:21:35) SirBabyface [~TiagoCorr@a81-84-240-210.cpe.netcabo.pt] entered the room.
(06:54:28) SirBabyface left the room (quit: Remote host closed the connection).
(09:10:38) kichik left the room (quit: ).
(09:24:54) NekoMSG left the room (quit: ).
(09:58:33) Anders [~who@215.80-202-61.nextgentel.com] entered the room.
(09:59:40) SirBabyface [~TiagoCorr@a81-84-240-210.cpe.netcabo.pt] entered the room.
(10:04:34) Anders: !seen Dave
(10:04:36) Beefcake: Dave (~dave@pool-141-150-16-73.mad.east.verizon.net) was last seen quitting from #nsis 1 year, 121 days, 7 hours, 49 minutes ago stating (Ping timeout: 258 seconds).
(10:05:01) lithium left the room (quit: Quit: Client Exiting).
(11:36:57) SirBabyface left the room (quit: Remote host closed the connection).
(12:41:05) Message [~Message@82.74.212.39] entered the room.
(12:57:54) ___gints_ [~gints@62.84.15.211] entered the room.
(12:59:48) __gints__ left the room (quit: Ping timeout: 248 seconds).
(13:35:20) dayton1 [~DLOW@208.82.104.178] entered the room.
(13:36:44) dayton1 left the room.
(18:45:11) Message left the room (quit: ).
(23:46:08) Anders left the room (quit: Ping timeout: 248 seconds).
(2009-08-22 00:54:18) Pendragon: anyone here?
If you look at the time stamps, you can see 2 days pass.

Funniest part of that, Beefcake, "was last seen quitting from #nsis 1 year, 121 days, 7 hours, 49 minutes ago stating (Ping timeout: 258 seconds)." I want to use his internet provider.

(09:58:33) Anders [...] entered the room. < whee there I am

(10:04:34) Anders: !seen Dave < me talking


(23:46:08) Anders left the room (quit: Ping timeout: 248 seconds). < me going to bed (I'm the only one that said anything, but you had a 14 hour window there, but you said nothing)

Beefcake is a bot and was responding to my query, and that is not his uptime


Dave!