Old 22nd January 2007, 17:18   #1
ankurm
Junior Member
 
Join Date: Jan 2007
Location: GURGAON
Posts: 16
To add Checkboxes on FINISHPAGE

Hi
I am new to NSIS
I want to add checkboxes on my FINISHPAGE ....
one checkbox for Desktop Shortcut
and one to add icon in quick launch..

i know that i can add checkbox for Readme file
and also to run exe...

but i am not able to add checkboxes on FINISHPAGE.....

any help will be highly appreciated

Thanks
Ankur
ankurm is offline   Reply With Quote
Old 22nd January 2007, 18:00   #2
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
If you're not going to use the read me check box and/or the run check box, you may use MUI_FINISHPAGE_SHOWREADME_FUNCTION and/or MUI_FINISHPAGE_RUN_FUNCTION to assign your own actions for the check boxes, see MUI documentation http://nsis.sourceforge.net/Docs/Mod...UI/Readme.html
Otherwise you should edit the iospecial.ini at runtime before the finish page appears and add desired controls.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 23rd January 2007, 04:43   #3
ankurm
Junior Member
 
Join Date: Jan 2007
Location: GURGAON
Posts: 16
I am using readme checkbox....other than that i need two more checkboxes for desktop shortcut and one for quick launch icon..
I made some changes in iospecail.ini....but it is not working....
ankurm is offline   Reply With Quote
Old 23rd January 2007, 04:47   #4
Backland
Senior Member
 
Join Date: Sep 2006
Posts: 150
Attach your INI file so we can have a look...
Backland is offline   Reply With Quote
Old 23rd January 2007, 04:50   #5
ankurm
Junior Member
 
Join Date: Jan 2007
Location: GURGAON
Posts: 16
here is the ini file

[Settings]
Rect=1044
NumFields=5

[Field 1]
Type=bitmap
Left=0
Right=109
Top=0
Bottom=193
Flags=RESIZETOFIT

[Field 2]
Type=label
Left=120
Right=315
Top=10

[Field 3]
Type=label
Left=120
Right=315

[Field 4]
Type=CheckBox
Text=Create Shortcut on Desktop
Flags=NOTIFY
State=1
Left=120
Right=315
Top=60
Bottom=78


[Field 5]
Type=CheckBox
Flags=NOTIFY
Text=Add to Quick Launch
State=1
Left=-200
Right=-140
Top=30
Bottom=48
ankurm is offline   Reply With Quote
Old 23rd January 2007, 04:52   #6
ankurm
Junior Member
 
Join Date: Jan 2007
Location: GURGAON
Posts: 16
i added 2 checkboxes as per my requirment on this ini
ankurm is offline   Reply With Quote
Old 23rd January 2007, 05:47   #7
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
code:
;NSIS Modern User Interface
;Welcome/Finish Page Example Script
;Written by Joost Verburg

;--------------------------------
;Include Modern UI

!include "MUI.nsh"

;--------------------------------
;General

;Name and file
Name "Modern UI Test"
OutFile "WelcomeFinish.exe"

;Default installation folder
InstallDir "$PROGRAMFILES\Modern UI Test"

;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\Modern UI Test" ""

;--------------------------------
;Interface Settings

!define MUI_ABORTWARNING

;--------------------------------
;Pages

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

;--------------------------------
;Modified Finish Page

!define MUI_PAGE_CUSTOMFUNCTION_PRE fin_pre
!define MUI_PAGE_CUSTOMFUNCTION_SHOW fin_show
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE fin_leave
!define MUI_FINISHPAGE_SHOWREADME "${NSISDIR}\Docs\Modern UI\Changelog.txt"
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_FUNCTION Desc_ShortCut
!define MUI_FINISHPAGE_RUN_TEXT "Create Desktop Shortcut"
!insertmacro MUI_PAGE_FINISH

!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH

;--------------------------------
;Languages

!insertmacro MUI_LANGUAGE "English"

;--------------------------------
;Installer Functions

Function Desc_Shortcut
SetOutPath "$INSTDIR"
CreateShortCut "$DESKTOP\my program.lnk" "$INSTDIR\makensisw.exe"
FunctionEnd

Function fin_show
ReadINIStr $0 "$PLUGINSDIR\iospecial.ini" "Field 6" "HWND"
SetCtlColors $0 0x000000 0xFFFFFF
FunctionEnd

Function fin_pre
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Settings" "NumFields" "6"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "Type" "CheckBox"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "Text" "&Create Quicklaunch Shortcut"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "Left" "120"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "Right" "315"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "Top" "130"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "Bottom" "140"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "State" "1"
FunctionEnd

Function fin_leave
ReadINIStr $0 "$PLUGINSDIR\iospecial.ini" "Field 6" "State"
StrCmp $0 "0" end
SetOutPath "$INSTDIR"
CreateShortCut "$QUICKLAUNCH\my program.lnk" "$INSTDIR\makensisw.exe"
end:
FunctionEnd

;--------------------------------
;Installer Sections

Section "Dummy Section" SecDummy

SetOutPath "$INSTDIR"

;ADD YOUR OWN FILES HERE...
File "${NSISDIR}\makensisw.exe"


;Store installation folder
WriteRegStr HKCU "Software\Modern UI Test" "" $INSTDIR

;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"

SectionEnd

;--------------------------------
;Descriptions

;Language strings
LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."

;Assign language strings to sections
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
!insertmacro MUI_FUNCTION_DESCRIPTION_END

;--------------------------------
;Uninstaller Section

Section "Uninstall"

;ADD YOUR OWN FILES HERE...

Delete "$INSTDIR\makensisw.exe"
Delete "$INSTDIR\Uninstall.exe"

RMDir "$INSTDIR"

DeleteRegKey /ifempty HKCU "Software\Modern UI Test"

SectionEnd


Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 23rd January 2007, 06:12   #8
ankurm
Junior Member
 
Join Date: Jan 2007
Location: GURGAON
Posts: 16
thanx a lot for the code.....
ankurm is offline   Reply With Quote
Old 23rd January 2007, 08:04   #9
ankurm
Junior Member
 
Join Date: Jan 2007
Location: GURGAON
Posts: 16
Red Wine can you please send me iospecial.ini that you used.
i am getting problem related to create desktop shortcut checkbox,as i try to uncheck or check that checkbox finish page closes.
same with read me check box.
i think this is problem related to ini.
so can u please send me that file
ankurm is offline   Reply With Quote
Old 23rd January 2007, 08:36   #10
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
I haven't use any particular iospecial.ini, it is just the iospecial.ini that is used by MUI to display the welcome/finish pages. What I'm actually doing is to edit this ini at runtime in order to add the extra checkbox control.
Compile and run and examine the provided above example, everything is pretty clear I guess.
The used from MUI iospecial.ini is located inside NSIS installation directory (usually program files\nsis) at Contrib\Modern UI.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 23rd January 2007, 10:50   #11
ankurm
Junior Member
 
Join Date: Jan 2007
Location: GURGAON
Posts: 16
Still i am facing a problem.
i make a customize page and i place 2 checkbox on that page...
now whenever i check/uncheck those checkboxes,installer is going on next page...just like i clicked next button which i didn't
checkboxes are working fine....
i don't know why this problem is coming
any body please help me
ankurm is offline   Reply With Quote
Old 23rd January 2007, 11:25   #12
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
I suspect you've added notify flag, this is the only reason I could think that causes this issue. Notify flag is veeery useful, though, you don't need it at the moment.
Again, allow me ask, did you examine the above provided example?
It's just a matter of copy/paste the code to your script.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 23rd January 2007, 11:29   #13
ankurm
Junior Member
 
Join Date: Jan 2007
Location: GURGAON
Posts: 16
thanx

i was using notify flag....that was creating all the problems....

thanx a lot
ya i used above code...
and now my problem is solved....
thanx again
ankurm is offline   Reply With Quote
Old 30th September 2008, 14:35   #14
r99t
Junior Member
 
Join Date: Apr 2008
Location: Lüneburg, Germany
Posts: 19
Is it possible to force (READONLY) the checkbox for the readme.txt?
r99t is offline   Reply With Quote
Old 24th September 2009, 18:02   #15
timjulien
Junior Member
 
Join Date: Sep 2009
Posts: 2
Will this technique work for the uninstaller confirm page in MUI or MUI2?
timjulien is offline   Reply With Quote
Old 25th September 2009, 08:35   #16
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Probably, but you're better off using nsDialogs instead of InstallOptions.
MSG 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