Old 23rd January 2008, 01:00   #1
lovespy108
Member
 
Join Date: Sep 2007
Posts: 63
Close page window automaticly and safely?

Var AlreadySetup
Var Modify

!macro MAINTENANCE
page custom ModifyShow ModifyLeave
!macroend

!insertmacro MAINTENANCE //my own macro
!insertmacro MUI_PAGE_WELCOME

Function .onInit
...
IfFileExists "$INSTDIR\myApplication.exe" 0 +3
StrCpy $AlreadySetup 1
goto End
...
End:
FunctionEnd

Function ModifyShow

${If} $AlreadySetup == 1
InstallOptions::initDialog /NOUNLOAD "$R0\modify.ini"
InstallOptions::show
${EndIf}

FunctionEnd

Function ModifyLeave

ReadINIStr $Modify "$R0\modify.ini" "Field 2" "State"
${If} $Modify == 0
ExecShell "open" "$INSTDIR\uninst.exe"
************************************************
my problem is at here?????????
************************************************
${Else}
Call RunOrNot //call my own function
${EndIf}

FunctionEnd
----------------------------------------------------------
How to realize the following purpose?
-After it executed [ExecShell...] ,I want that the custom page window can close automaticly and safely.Then the setup is finished at here.
----------------------------------------------------------

Thanks very much for help!!!
lovespy108 is offline   Reply With Quote
Old 23rd January 2008, 01:09   #2
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
simply call Quit?

Quote:
4.9.4.17 Quit
Causes the installer to exit as soon as possible. After Quit is called, the installer will exit (no callback functions will get a chance to run).
Animaether is offline   Reply With Quote
Old 23rd January 2008, 01:18   #3
lovespy108
Member
 
Join Date: Sep 2007
Posts: 63
Thank you! It can work so well.
lovespy108 is offline   Reply With Quote
Old 23rd January 2008, 01:47   #4
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
just make sure you don't have any cleanup code in any callbacks that would normally run when the installer finishes. If you do, you'll have to either duplicate that cleanup code, or use a different method instead. E.g. in an installer I maintain, a 'skip' variable is set to true and each page calls Abort if that variable is true - thereby skipping that page.
Animaether is offline   Reply With Quote
Old 23rd January 2008, 02:58   #5
lovespy108
Member
 
Join Date: Sep 2007
Posts: 63
Yes.I did that like your method.I found that way occasionally.@_@^_^
lovespy108 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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