3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-27 01:15:36 +02:00

Lots and lots of changes to installer

This commit is contained in:
Leonardo Murillo 2015-12-23 14:16:49 -06:00
parent ec6f572d68
commit baf095f4af
5 changed files with 204 additions and 173 deletions

View file

@ -1,28 +1,30 @@
macro(CONSOLIDATE_STACK_COMPONENTS)
if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE)
if (WIN32)
# Copy all the output for this target into the common deployment location
add_custom_command(
TARGET ${TARGET_NAME} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_directory $<TARGET_FILE_DIR:${TARGET_NAME}> ${CMAKE_BINARY_DIR}/full-stack-deployment
)
# Copy icon files for interface and stack manager
if (TARGET_NAME STREQUAL "interface" OR TARGET_NAME STREQUAL "stack-manager")
if (TARGET_NAME STREQUAL "interface")
set (ICON_FILE_PATH "${PROJECT_SOURCE_DIR}/icon/${INTERFACE_ICON}")
set (ICON_DESTINATION_NAME "interface.ico")
elseif (TARGET_NAME STREQUAL "stack-manager")
set (ICON_FILE_PATH "${PROJECT_SOURCE_DIR}/assets/${STACK_MANAGER_ICON}")
set (ICON_DESTINATION_NAME "stack-manager.ico")
endif ()
add_custom_command(
TARGET ${TARGET_NAME} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy ${ICON_FILE_PATH} ${CMAKE_BINARY_DIR}/full-stack-deployment/${ICON_DESTINATION_NAME}
)
endif ()
endif ()
endif ()
macro(CONSOLIDATE_STACK_COMPONENTS)
if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE)
if (WIN32)
# Copy icon files for interface and stack manager
if (TARGET_NAME STREQUAL "interface" OR TARGET_NAME STREQUAL "stack-manager")
if (TARGET_NAME STREQUAL "interface")
set (ICON_FILE_PATH "${PROJECT_SOURCE_DIR}/icon/${INTERFACE_ICON}")
set (ICON_DESTINATION_NAME "interface.ico")
set (DEPLOYMENT_PATH "front-end-deployment")
else ()
set (ICON_FILE_PATH "${PROJECT_SOURCE_DIR}/assets/${STACK_MANAGER_ICON}")
set (ICON_DESTINATION_NAME "stack-manager.ico")
set (DEPLOYMENT_PATH "back-end-deployment")
endif ()
add_custom_command(
TARGET ${TARGET_NAME} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy ${ICON_FILE_PATH} ${CMAKE_BINARY_DIR}/${DEPLOYMENT_PATH}/${ICON_DESTINATION_NAME}
COMMAND "${CMAKE_COMMAND}" -E copy_directory $<TARGET_FILE_DIR:${TARGET_NAME}> ${CMAKE_BINARY_DIR}/${DEPLOYMENT_PATH}
)
else ()
add_custom_command(
TARGET ${TARGET_NAME} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_directory $<TARGET_FILE_DIR:${TARGET_NAME}> ${CMAKE_BINARY_DIR}/back-end-deployment
)
endif ()
endif ()
endif ()
endmacro()

View file

@ -1,30 +1,32 @@
#
# GenerateInstallers.cmake
# cmake/macros
#
# Created by Leonardo Murillo on 12/16/2015.
# Copyright 2015 High Fidelity, Inc.
#
# Distributed under the Apache License, Version 2.0.
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
#
macro(GENERATE_INSTALLERS)
if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE AND WIN32)
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/full-stack-deployment")
find_program(MAKENSIS_COMMAND makensis PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\NSIS])
if (NOT MAKENSIS_COMMAND)
message(FATAL_ERROR "The Nullsoft Scriptable Install Systems is required for generating packaged installers on Windows (http://nsis.sourceforge.net/)")
endif ()
add_custom_target(
build-package ALL
DEPENDS interface assignment-client domain-server stack-manager
COMMAND set INSTALLER_SOURCE_DIR=${CMAKE_BINARY_DIR}/full-stack-deployment
COMMAND set INSTALLER_NAME=${CMAKE_BINARY_DIR}/${INSTALLER_NAME}
COMMAND set INSTALLER_SCRIPTS_DIR=${CMAKE_SOURCE_DIR}/examples
COMMAND set INSTALLER_COMPANY=${INSTALLER_COMPANY}
COMMAND set INSTALLER_DIRECTORY=${INSTALLER_DIRECTORY}
COMMAND CMD /C "\"${MAKENSIS_COMMAND}\" ${CMAKE_SOURCE_DIR}/tools/nsis/release.nsi"
)
endif ()
#
# GenerateInstallers.cmake
# cmake/macros
#
# Created by Leonardo Murillo on 12/16/2015.
# Copyright 2015 High Fidelity, Inc.
#
# Distributed under the Apache License, Version 2.0.
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
#
macro(GENERATE_INSTALLERS)
if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE AND WIN32)
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/front-end-deployment")
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/back-end-deployment")
find_program(MAKENSIS_COMMAND makensis PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\NSIS])
if (NOT MAKENSIS_COMMAND)
message(FATAL_ERROR "The Nullsoft Scriptable Install Systems is required for generating packaged installers on Windows (http://nsis.sourceforge.net/)")
endif ()
add_custom_target(
build-package ALL
DEPENDS interface assignment-client domain-server stack-manager
COMMAND set INSTALLER_FRONTEND_DIR=${CMAKE_BINARY_DIR}/front-end-deployment
COMMAND set INSTALLER_BACKEND_DIR=${CMAKE_BINARY_DIR}/back-end-deployment
COMMAND set INSTALLER_NAME=${CMAKE_BINARY_DIR}/${INSTALLER_NAME}
COMMAND set INSTALLER_SCRIPTS_DIR=${CMAKE_SOURCE_DIR}/examples
COMMAND set INSTALLER_COMPANY=${INSTALLER_COMPANY}
COMMAND set INSTALLER_DIRECTORY=${INSTALLER_DIRECTORY}
COMMAND CMD /C "\"${MAKENSIS_COMMAND}\" ${CMAKE_SOURCE_DIR}/tools/nsis/release.nsi"
)
endif ()
endmacro()

View file

@ -258,7 +258,8 @@ if (WIN32)
if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE)
add_custom_command(
TARGET ${TARGET_NAME} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy ${OPENSSL_DLL_PATH}/ssleay32.dll ${CMAKE_BINARY_DIR}/full-stack-deployment/
COMMAND "${CMAKE_COMMAND}" -E copy ${OPENSSL_DLL_PATH}/ssleay32.dll ${CMAKE_BINARY_DIR}/front-end-deployment/
COMMAND "${CMAKE_COMMAND}" -E copy ${OPENSSL_DLL_PATH}/ssleay32.dll ${CMAKE_BINARY_DIR}/back-end-deployment/
)
endif ()
endif ()

Binary file not shown.

After

(image error) Size: 151 KiB

View file

@ -1,164 +1,190 @@
!include LogicLib.nsh
!include x64.nsh
!include MUI2.nsh
;------------------------------------------------------------------------------------------------------
; Source Directory Definition
;
; frontend_srcdir = Source directory for Interface
; backend_srcdir = Source directory for Stack Manager and server stack
; scripts_srcdir = Source directory for JS scripts
!define frontend_srcdir "$%INSTALLER_FRONTEND_DIR%"
!define backend_srcdir "$%INSTALLER_BACKEND_DIR%"
!define scripts_srcdir "$%INSTALLER_SCRIPTS_DIR%"
; Install Directories, Icons and Registry entries
;
; setup = Name of the installer executable that will be produced
; uninstaller = Name of the uninstaller executable
; company = String to use for company name, includes build type suffix [eg. High Fidelity - PR] for non-release installers
; install_directory = Subdirectory where this specific version will be installed, in the case of dev and pr builds, its a
; unique subdirectory inside a company parent [eg. \High Fidelity - PR\1234\ ]
!define srcdir "$%INSTALLER_SOURCE_DIR%"
!define setup "$%INSTALLER_NAME%"
!define scriptsdir "$%INSTALLER_SCRIPTS_DIR%"
!define uninstaller "uninstall.exe"
!define company "$%INSTALLER_COMPANY%"
!define install_directory "$%INSTALLER_DIRECTORY%"
; Executables and icons for GUI applications that will be added as shortcuts.
!define interface_exec "interface.exe"
!define stack_manager_exec "stack-manager.exe"
!define interface_icon "interface.ico"
!define stack_manager_icon "stack-manager.ico"
!define regkey "Software\${company}"
!define uninstkey "Software\Microsoft\Windows\CurrentVersion\Uninstall\${company}"
!define install_dir_company "$PROGRAMFILES64\${install_directory}"
; Registry entries
!define regkey "Software\${install_directory}"
!define uninstkey "Software\Microsoft\Windows\CurrentVersion\Uninstall\${install_directory}"
!define frontend_instdir "$PROGRAMFILES64\${install_directory}"
!define backend_instdir "$APPDATA\${install_directory}"
; Start Menu program group
!define startmenu_company "$SMPROGRAMS\${install_directory}"
!define uninstaller "uninstall.exe"
;--------------------------------
;------------------------------------------------------------------------------------------------------
; Local Variables and Other Options
Var ChosenFrontEndInstallDir
Var ChosenBackEndInstallDir
XPStyle on
ShowInstDetails hide
ShowUninstDetails hide
Name "${company}"
Caption "${company}"
!ifdef icon
Icon "${icon}"
!endif
OutFile "${setup}"
AutoCloseWindow true
ShowInstDetails show
SetDateSave on
SetDatablockOptimize on
CRCCheck on
SilentInstall normal
Icon "${frontend_srcdir}\${interface_icon}"
UninstallIcon "${frontend_srcdir}\${interface_icon}"
UninstallText "This will uninstall ${company}."
Name "${company}"
Caption "${company}"
OutFile "${setup}"
InstallDir "${install_dir_company}"
InstallDirRegKey HKLM "${regkey}" ""
;------------------------------------------------------------------------------------------------------
; Components
; Page components
Page directory
Page components
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
;--------------------------------
AutoCloseWindow true
ShowInstDetails show
!ifdef screenimage
; set up background image
; uses BgImage plugin
Function .onGUIInit
; extract background BMP into temp plugin directory
InitPluginsDir
File /oname=$PLUGINSDIR\1.bmp "${screenimage}"
BgImage::SetBg /NOUNLOAD /FILLSCREEN $PLUGINSDIR\1.bmp
BgImage::Redraw /NOUNLOAD
FunctionEnd
Function .onGUIEnd
; Destroy must not have /NOUNLOAD so NSIS will be able to unload and delete BgImage before it exits
BgImage::Destroy
FunctionEnd
!endif
; Optional Component Selection
Section /o "DDE Face Recognition" SEC01
SetOutPath "$INSTDIR"
CreateDirectory $INSTDIR\dde
NSISdl::download "https://s3-us-west-1.amazonaws.com/hifi-production/optionals/dde-installer.exe" "$INSTDIR\dde-installer.exe"
ExecWait '"$INSTDIR\dde-installer.exe" /q:a /t:"$INSTDIR\dde"'
SetOutPath "$ChosenFrontEndInstallDir"
CreateDirectory $ChosenFrontEndInstallDir\dde
NSISdl::download "https://s3-us-west-1.amazonaws.com/hifi-production/optionals/dde-installer.exe" "$ChosenFrontEndInstallDir\dde-installer.exe"
ExecWait '"$ChosenFrontEndInstallDir\dde-installer.exe" /q:a /t:"$ChosenFrontEndInstallDir\dde"'
SectionEnd
; beginning (invisible) section
Section "Registry Entries and Procotol Handler" SEC02
SectionIn RO
WriteRegStr HKLM "${regkey}" "Install_Dir" "$INSTDIR"
WriteRegStr HKLM "${regkey}" "Install_Dir" "$ChosenFrontEndInstallDir"
WriteRegStr HKLM "${uninstkey}" "DisplayName" "${install_directory} (remove only)"
WriteRegStr HKLM "${uninstkey}" "UninstallString" '"$INSTDIR\${uninstaller}"'
WriteRegStr HKCR "${company}\Shell\open\command\" "" '"$INSTDIR\${interface_exec} "%1"'
WriteRegStr HKCR "${company}\DefaultIcon" "" "$INSTDIR\${interface_icon}"
WriteRegStr HKLM "${uninstkey}" "UninstallString" '"$ChosenFrontEndInstallDir\${uninstaller}"'
WriteRegStr HKCR "${company}\Shell\open\command\" "" '"$ChosenFrontEndInstallDir\${interface_exec} "%1"'
WriteRegStr HKCR "${company}\DefaultIcon" "" "$ChosenFrontEndInstallDir\${interface_icon}"
; hifi:// protocol handler registry entries
WriteRegStr HKCR 'hifi' '' 'URL:Alert Protocol'
WriteRegStr HKCR 'hifi' 'URL Protocol' ''
WriteRegStr HKCR 'hifi\DefaultIcon' '' '$INSTDIR\${interface_icon},1'
WriteRegStr HKCR 'hifi\shell\open\command' '' '$INSTDIR\${interface_exec} --url "%1"'
WriteRegStr HKCR 'hifi\DefaultIcon' '' '$ChosenFrontEndInstallDir\${interface_icon},1'
WriteRegStr HKCR 'hifi\shell\open\command' '' '$ChosenFrontEndInstallDir\${interface_exec} --url "%1"'
SetOutPath $INSTDIR
; package all files, recursively, preserving attributes
; assume files are in the correct places
File /r "${srcdir}\"
File /a "${srcdir}\${interface_icon}"
File /a "${srcdir}\${stack_manager_icon}"
; any application-specific files
!ifdef files
!include "${files}"
!endif
WriteUninstaller "${uninstaller}"
Exec '"$INSTDIR\2013_vcredist_x64.exe" /q /norestart'
Exec '"$INSTDIR\2010_vcredist_x86.exe" /q /norestart'
WriteUninstaller "$ChosenFrontEndInstallDir\${uninstaller}"
Exec '"$ChosenFrontEndInstallDir\2013_vcredist_x64.exe" /q /norestart'
Exec '"$ChosenFrontEndInstallDir\2010_vcredist_x86.exe" /q /norestart'
SectionEnd
; create shortcuts
Section "Start Menu Shortcuts" SEC03
Section "Interface Client" SEC03
SetOutPath $ChosenFrontEndInstallDir
File /r "${frontend_srcdir}\"
File /a "${frontend_srcdir}\${interface_icon}"
SectionEnd
SectionIn RO
Section "Stack Manager Bundle" SEC04
SetOutPath $ChosenBackEndInstallDir
File /r "${backend_srcdir}\"
File /a "${backend_srcdir}\${stack_manager_icon}"
SectionEnd
; This should install the shortcuts for "All Users"
Section "Start Menu Shortcuts" SEC05
SetShellVarContext all
CreateDirectory "${startmenu_company}"
SetOutPath $INSTDIR ; for working directory
CreateShortCut "${startmenu_company}\Interface.lnk" "$INSTDIR\${interface_exec}" "" "$INSTDIR\${interface_icon}"
CreateShortCut "${startmenu_company}\Stack Manager.lnk" "$INSTDIR\${stack_manager_exec}" "" "$INSTDIR\${stack_manager_icon}"
CreateShortCut "${startmenu_company}\Uninstall ${company}.lnk" "$INSTDIR\${uninstaller}"
SetOutPath $ChosenFrontEndInstallDir
CreateShortCut "${startmenu_company}\Interface.lnk" "$ChosenFrontEndInstallDir\${interface_exec}" "" "$ChosenFrontEndInstallDir\${interface_icon}"
CreateShortCut "${startmenu_company}\Stack Manager.lnk" "$ChosenBackEndInstallDir\${stack_manager_exec}" "" "$ChosenBackEndInstallDir\${stack_manager_icon}"
CreateShortCut "${startmenu_company}\Uninstall ${company}.lnk" "$ChosenFrontEndInstallDir\${uninstaller}"
SectionEnd
; Uninstaller
; All section names prefixed by "Un" will be in the uninstaller
UninstallText "This will uninstall ${company}."
!ifdef icon
UninstallIcon "${interface_icon}"
!endif
Section "Uninstall" SEC04
SectionIn RO
; Explicitly remove all added shortcuts
Section "Uninstall"
SetShellVarContext all
DELETE "${startmenu_company}\Interface.lnk"
DELETE "${startmenu_company}\Stack Manager.lnk"
DELETE "${startmenu_company}\Uninstall ${company}.lnk"
RMDIR "${startmenu_company}"
RMDIR /r "$INSTDIR"
; This should remove the High Fidelity folder in Program Files if it's empty
RMDIR "${install_dir_company}"
!ifdef unfiles
!include "${unfiles}"
!endif
; It's good practice to put the registry key removal at the very end
RMDIR /r "$ChosenBackEndInstallDir"
RMDIR /r "$ChosenFrontEndInstallDir"
RMDIR "${install_directory}"
DeleteRegKey HKLM "${uninstkey}"
DeleteRegKey HKLM "${regkey}"
DeleteRegKey HKCR 'hifi'
SectionEnd
SectionEnd
;------------------------------------------------------------------------------------------------------
; Functions
Function .onInit
StrCpy $ChosenFrontEndInstallDir "${frontend_instdir}"
StrCpy $ChosenBackEndInstallDir "${backend_instdir}"
FunctionEnd
Function isInterfaceSelected
${IfNot} ${SectionIsSelected} ${SEC03}
Abort
${EndIf}
FunctionEnd
Function isStackManagerSelected
${IfNot} ${SectionIsSelected} ${SEC04}
Abort
${EndIf}
FunctionEnd
;------------------------------------------------------------------------------------------------------
; User interface macros and other definitions
!define MUI_WELCOMEFINISHPAGE_BITMAP "installer_vertical.bmp"
!define MUI_WELCOMEPAGE_TITLE "High Fidelity - Integrated Installer"
!define MUI_WELCOMEPAGE_TEXT "Welcome to High Fidelity! This installer includes both the Interface client for VR access as well as the Stack Manager and required server components for you to host your own domain in the metaverse."
!insertmacro MUI_PAGE_WELCOME
!define MUI_PAGE_HEADER_TEXT "Please select the components you want to install"
!define MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO "Hover over a component for a brief description"
!insertmacro MUI_PAGE_COMPONENTS
!define MUI_PAGE_CUSTOMFUNCTION_PRE isInterfaceSelected
!define MUI_DIRECTORYPAGE_VARIABLE $ChosenFrontEndInstallDir
!define MUI_PAGE_HEADER_TEXT "Interface client"
!define MUI_PAGE_HEADER_SUBTEXT ""
!define MUI_DIRECTORYPAGE_TEXT_TOP "Choose a location to install the High Fidelity Interface client. You will use the Interface client to connect to domains in the metaverse."
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Install Directory"
!insertmacro MUI_PAGE_DIRECTORY
!define MUI_PAGE_CUSTOMFUNCTION_PRE isStackManagerSelected
!define MUI_DIRECTORYPAGE_VARIABLE $ChosenBackEndInstallDir
!define MUI_PAGE_HEADER_TEXT "Stack Manager"
!define MUI_PAGE_HEADER_SUBTEXT ""
!define MUI_DIRECTORYPAGE_TEXT_TOP "Choose a location to install the High Fidelity Stack Manager bundle, including back end components. NOTE: If you change the default path, make sure you're selecting an unprivileged location, otherwise you will be forced to run the application as administrator for correct functioning."
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Install Directory - must be writable"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "DDE enables facial gesture recognition using a standard 2D webcam"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Registry entries are required by the system, we will also add a hifi:// protocol handler"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "Interface is the GUI client to access domains running the High Fidelity VR stack"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "The Stack Manager allows you to run a domain of your own and connect it to the High Fidelity metaverse"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC05} "Adds a program group and shortcuts to the Start Menu"
!insertmacro MUI_FUNCTION_DESCRIPTION_END
!insertmacro MUI_LANGUAGE "English"