use nsDialogs for custom post install options

This commit is contained in:
Stephen Birarda 2016-01-11 17:26:40 -08:00
parent dd0f541759
commit 288b044a0f
3 changed files with 14 additions and 19 deletions

View file

@ -22,12 +22,6 @@ macro(GENERATE_INSTALLERS)
set(CPACK_NSIS_PACKAGE_NAME ${_DISPLAY_NAME})
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${_DISPLAY_NAME})
# configure the post install options file for custom installation options
if (WIN32)
set(POST_INSTALL_OPTIONS_PATH "${CMAKE_CURRENT_BINARY_DIR}/NSIS.PostInstallOptions.ini")
configure_file("${HF_CMAKE_DIR}/templates/NSIS.PostInstallOptions.ini.in" ${POST_INSTALL_OPTIONS_PATH})
endif ()
# configure a cpack properties file for custom variables in NSIS template
set(CPACK_CONFIGURED_PROP_FILE "${CMAKE_CURRENT_BINARY_DIR}/CPackCustomProperties.cmake")
configure_file("${HF_CMAKE_DIR}/templates/CPackProperties.cmake.in" ${CPACK_CONFIGURED_PROP_FILE})

View file

@ -1,10 +0,0 @@
[Settings]
NumFields = 3
[Field 1]
Type=checkBox
Text=Create a desktop shortcut for High Fidelity
Left=0
Right=-1
Top=0
Bottom=20

View file

@ -19,6 +19,9 @@
Var ADD_TO_PATH_CURRENT_USER
Var INSTALL_DESKTOP
Var IS_DEFAULT_INSTALLDIR
Var POST_INSTALL_DIALOG
Var DESKTOP_CHECKBOX
;--------------------------------
;Include Modern UI
@ -766,9 +769,17 @@ Function InstallOptionsPage
FunctionEnd
Function PostInstallOptionsPage
!insertmacro MUI_HEADER_TEXT "Post-Install Options"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "@POST_INSTALL_OPTIONS_PATH@"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "@POST_INSTALL_OPTIONS_PATH@"
nsDialogs::Create 1018
Pop $POST_INSTALL_DIALOG
${If} $POST_INSTALL_DIALOG == error
Abort
${EndIf}
${NSD_CreateCheckbox} 0 0 100% 10u "&Create High Fidelity Desktop Shortcut"
Pop $DESKTOP_CHECKBOX
nsDialogs::Show
FunctionEnd
;--------------------------------