From d811660ed6f0da1574aadb2d114f1649ae84eb81 Mon Sep 17 00:00:00 2001 From: Leonardo Murillo Date: Wed, 9 Dec 2015 11:07:10 -0800 Subject: [PATCH 1/8] DO NOT MERGE - Testing PR environment --- README.md | 2 ++ cmake/modules/FindOpenSSL.cmake | 1 + 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index a2eb058ae6..7741445842 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +### TESTING BUILD - DO NOT MERGE ### + High Fidelity (hifi) is an early-stage technology lab experimenting with Virtual Worlds and VR. In this repository you'll find the source to many of the components in our diff --git a/cmake/modules/FindOpenSSL.cmake b/cmake/modules/FindOpenSSL.cmake index 9d9557ad9e..6893948d01 100644 --- a/cmake/modules/FindOpenSSL.cmake +++ b/cmake/modules/FindOpenSSL.cmake @@ -256,6 +256,7 @@ if (WIN32) # For some reason fixup misses the following DLL and only copies libeay32. There's gotta be a better way to handle this # but for now resorting to the following interm solution if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE) + message(STATUS "*********** Copying SSL DLL from ${OPENSSL_DLL_PATH}/ssleay32.dll") add_custom_command( TARGET ${TARGET_NAME} POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy ${OPENSSL_DLL_PATH}/ssleay32.dll ${CMAKE_BINARY_DIR}/full-stack-deployment/ From 711d02ba2f44d7bef93c36e8079642d35e72e105 Mon Sep 17 00:00:00 2001 From: Leonardo Murillo Date: Wed, 16 Dec 2015 14:26:24 -0600 Subject: [PATCH 2/8] Consolidating installer checkpoint --- CMakeLists.txt | 42 ++--- cmake/macros/ConsolidateStackComponents.cmake | 37 ++-- cmake/modules/FindOpenSSL.cmake | 1 - tools/nsis/release.nsi | 176 ++++++++++++++++++ 4 files changed, 207 insertions(+), 49 deletions(-) create mode 100644 tools/nsis/release.nsi diff --git a/CMakeLists.txt b/CMakeLists.txt index a8271abd8e..836b808a4c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12.2) +cmake_minimum_required(VERSION 3.3.2) if (USE_ANDROID_TOOLCHAIN) set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/android/android.toolchain.cmake") @@ -230,32 +230,14 @@ endif () include_application_version() if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE) - message(STATUS "+++++ Package for deployment will be generated on this build +++++") - - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/full-stack-deployment) - - set(ICONPATH_INTERFACE "$INSTDIR/${PATH_INSTALL_DATA}/interface.ico") - set(ICONPATH_STACK_MANAGER "$INSTDIR/${PATH_INSTALL_DATA}/stack-manager.ico") - string(REPLACE "/" "\\\\" ICONPATH_INTERFACE ${ICONPATH_INTERFACE}) - string(REPLACE "/" "\\\\" ICONPATH_STACK_MANAGER ${ICONPATH_STACK_MANAGER}) - - set(CPACK_PACKAGE_NAME "High Fidelity") - set(CPACK_PACKAGE_VENDOR "High Fidelity, Inc") - set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "High Fidelity Interface and Stack") - set(CPACK_PACKAGE_VERSION "${BUILD_SEQ}") - set(CPACK_PACKAGE_VERSION_MAJOR "${BUILD_SEQ}") - set(CPACK_PACKAGE_VERSION_MINOR "0") - set(CPACK_PACKAGE_VERSION_PATCH "0") - set(CPACK_PACKAGE_INSTALL_DIRECTORY "High Fidelity-${BUILD_SEQ}") - set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".") - set(CPACK_PACKAGE_EXECUTABLES - stack-manager "Stack Manager" - interface "Interface" - ) - - if (WIN32) - install(DIRECTORY ${CMAKE_BINARY_DIR}/full-stack-deployment/ DESTINATION "./") - endif (WIN32) - - include(CPack) -endif () + 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 CMD /C "\"${MAKENSIS_COMMAND}\" ${CMAKE_SOURCE_DIR}/tools/nsis/release.nsi" + ) +endif () \ No newline at end of file diff --git a/cmake/macros/ConsolidateStackComponents.cmake b/cmake/macros/ConsolidateStackComponents.cmake index 4bcc777751..ca272f6485 100644 --- a/cmake/macros/ConsolidateStackComponents.cmake +++ b/cmake/macros/ConsolidateStackComponents.cmake @@ -1,26 +1,27 @@ macro(CONSOLIDATE_STACK_COMPONENTS) - if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE AND 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 $ ${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.ico") - set (ICON_DESTINATION_NAME "interface.ico") - elseif (TARGET_NAME STREQUAL "stack-manager") - set (ICON_FILE_PATH "${PROJECT_SOURCE_DIR}/assets/icon.ico") - set (ICON_DESTINATION_NAME "stack-manager.ico") - endif () + 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 ${ICON_FILE_PATH} ${CMAKE_BINARY_DIR}/full-stack-deployment/${ICON_DESTINATION_NAME} + COMMAND "${CMAKE_COMMAND}" -E copy_directory $ ${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.ico") + set (ICON_DESTINATION_NAME "interface.ico") + elseif (TARGET_NAME STREQUAL "stack-manager") + set (ICON_FILE_PATH "${PROJECT_SOURCE_DIR}/assets/icon.ico") + 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 () diff --git a/cmake/modules/FindOpenSSL.cmake b/cmake/modules/FindOpenSSL.cmake index 6893948d01..9d9557ad9e 100644 --- a/cmake/modules/FindOpenSSL.cmake +++ b/cmake/modules/FindOpenSSL.cmake @@ -256,7 +256,6 @@ if (WIN32) # For some reason fixup misses the following DLL and only copies libeay32. There's gotta be a better way to handle this # but for now resorting to the following interm solution if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE) - message(STATUS "*********** Copying SSL DLL from ${OPENSSL_DLL_PATH}/ssleay32.dll") add_custom_command( TARGET ${TARGET_NAME} POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy ${OPENSSL_DLL_PATH}/ssleay32.dll ${CMAKE_BINARY_DIR}/full-stack-deployment/ diff --git a/tools/nsis/release.nsi b/tools/nsis/release.nsi new file mode 100644 index 0000000000..5b2cce5c61 --- /dev/null +++ b/tools/nsis/release.nsi @@ -0,0 +1,176 @@ +!include LogicLib.nsh +!include x64.nsh + +!define srcdir "E:\development\md-hifi\build\full-stack-deployment" ;$%INSTALLER_SOURCE_DIR% +!define setup "E:\development\md-hifi\build\installer-test.exe" ;$%INSTALLER_NAME% +!define scriptsdir "E:\development\md-hifi\examples" ;$%INSTALLER_SCRIPTS_DIR% +!define company "High Fidelity" +!define prodname "Interface" +!define exec "interface.exe" +!define icon "${srcdir}\interface.ico" +!define regkey "Software\${company}\${prodname}" +!define uninstkey "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}" +!define install_dir_company "$PROGRAMFILES64\${company}" +!define install_dir_product "${install_dir_company}\${prodname}" +!define startmenu_company "$SMPROGRAMS\${company}" +!define startmenu_product "${startmenu_company}\${prodname}" +!define uninstaller "uninstall.exe" + +;-------------------------------- + +XPStyle on +ShowInstDetails hide +ShowUninstDetails hide + +Name "${prodname}" +Caption "${prodname}" + +!ifdef icon + Icon "${icon}" +!endif + +OutFile "${setup}" + +SetDateSave on +SetDatablockOptimize on +CRCCheck on +SilentInstall normal + +InstallDir "${install_dir_product}" +InstallDirRegKey HKLM "${regkey}" "" + +; 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"' +SectionEnd + +; beginning (invisible) section +Section "Registry Entries and Procotol Handler" SEC02 + + SectionIn RO + + WriteRegStr HKLM "${regkey}" "Install_Dir" "$INSTDIR" + WriteRegStr HKLM "${uninstkey}" "DisplayName" "${prodname} (remove only)" + WriteRegStr HKLM "${uninstkey}" "UninstallString" '"$INSTDIR\${uninstaller}"' + WriteRegStr HKCR "${prodname}\Shell\open\command\" "" '"$INSTDIR\${exec} "%1"' + + !ifdef icon + WriteRegStr HKCR "${prodname}\DefaultIcon" "" "$INSTDIR\${icon}" + !endif + + ; hifi:// protocol handler registry entries + WriteRegStr HKCR 'hifi' '' 'URL:Alert Protocol' + WriteRegStr HKCR 'hifi' 'URL Protocol' '' + WriteRegStr HKCR 'hifi\DefaultIcon' '' '$INSTDIR\${icon},1' + WriteRegStr HKCR 'hifi\shell\open\command' '' '$INSTDIR\${exec} --url "%1"' + + SetOutPath $INSTDIR + + ; package all files, recursively, preserving attributes + ; assume files are in the correct places + File /r "${srcdir}\" + !ifdef icon + File /a "${icon}" + !endif + ; any application-specific files + !ifdef files + !include "${files}" + !endif + SetOutPath "$DOCUMENTS\${company}\Scripts" + File /r "${scriptsdir}\" + SetOutPath $INSTDIR + WriteUninstaller "${uninstaller}" + Exec '"$INSTDIR\2013_vcredist_x64.exe" /q /norestart' + Exec '"$INSTDIR\2010_vcredist_x86.exe" /q /norestart' +SectionEnd + +; create shortcuts +Section "Start Menu Shortcuts" SEC03 + + SectionIn RO + + ; This should install the shortcuts for "All Users" + SetShellVarContext all + CreateDirectory "${startmenu_product}" + SetOutPath $INSTDIR ; for working directory + !ifdef icon + CreateShortCut "${startmenu_product}\${prodname}.lnk" "$INSTDIR\${exec}" "" "$INSTDIR\${icon}" + !else + CreateShortCut "${startmenu_product}\${prodname}.lnk" "$INSTDIR\${exec}" + !endif + + CreateShortCut "${startmenu_product}\Uninstall ${prodname}.lnk" "$INSTDIR\${uninstaller}" +SectionEnd + +; Uninstaller +; All section names prefixed by "Un" will be in the uninstaller + +UninstallText "This will uninstall ${prodname}." + +!ifdef icon + UninstallIcon "${icon}" +!endif + +Section "Uninstall" SEC04 + + SectionIn RO + + ; Explicitly remove all added shortcuts + SetShellVarContext all + DELETE "${startmenu_product}\${prodname}.lnk" + DELETE "${startmenu_product}\Uninstall ${prodname}.lnk" + + RMDIR "${startmenu_product}" + ; This should remove the High Fidelity folder in Start Menu if it's empty + 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 + DeleteRegKey HKLM "${uninstkey}" + DeleteRegKey HKLM "${regkey}" + DeleteRegKey HKCR 'hifi' +SectionEnd \ No newline at end of file From 56ef52022dd17d9defc3fe25c144337b0826eb33 Mon Sep 17 00:00:00 2001 From: Leonardo Murillo Date: Wed, 16 Dec 2015 14:28:05 -0600 Subject: [PATCH 3/8] Removing unwanted changes --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 7741445842..a2eb058ae6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -### TESTING BUILD - DO NOT MERGE ### - High Fidelity (hifi) is an early-stage technology lab experimenting with Virtual Worlds and VR. In this repository you'll find the source to many of the components in our From 5ed422e3a19687a941fb5476212a30d854ccaaec Mon Sep 17 00:00:00 2001 From: Leonardo Murillo Date: Wed, 16 Dec 2015 14:28:49 -0600 Subject: [PATCH 4/8] Removing unwanted changes --- CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 836b808a4c..b2ed36a8c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,9 +67,9 @@ if ((NOT MSVC12) AND (NOT MSVC14)) CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) if (COMPILER_SUPPORTS_CXX11) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") elseif(COMPILER_SUPPORTS_CXX0X) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") else() message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") endif() @@ -235,9 +235,9 @@ if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE) 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 + add_custom_target( + build-package ALL + DEPENDS interface assignment-client domain-server stack-manager COMMAND CMD /C "\"${MAKENSIS_COMMAND}\" ${CMAKE_SOURCE_DIR}/tools/nsis/release.nsi" - ) + ) endif () \ No newline at end of file From cbed8bf35a8001c309b8a136fbd5c04650e96251 Mon Sep 17 00:00:00 2001 From: Leonardo Murillo Date: Wed, 16 Dec 2015 15:12:14 -0600 Subject: [PATCH 5/8] NSIS Changes --- CMakeLists.txt | 3 ++ tools/nsis/release.nsi | 71 +++++++++++++++++------------------------- 2 files changed, 32 insertions(+), 42 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b2ed36a8c5..69e6365c8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -238,6 +238,9 @@ if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE) 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}/this-is-a-test.exe + COMMANE set INSTALLER_SCRIPTS_DIR=${CMAKE_SOURCE_DIR}/examples COMMAND CMD /C "\"${MAKENSIS_COMMAND}\" ${CMAKE_SOURCE_DIR}/tools/nsis/release.nsi" ) endif () \ No newline at end of file diff --git a/tools/nsis/release.nsi b/tools/nsis/release.nsi index 5b2cce5c61..86ea055e6b 100644 --- a/tools/nsis/release.nsi +++ b/tools/nsis/release.nsi @@ -1,19 +1,18 @@ !include LogicLib.nsh !include x64.nsh -!define srcdir "E:\development\md-hifi\build\full-stack-deployment" ;$%INSTALLER_SOURCE_DIR% -!define setup "E:\development\md-hifi\build\installer-test.exe" ;$%INSTALLER_NAME% -!define scriptsdir "E:\development\md-hifi\examples" ;$%INSTALLER_SCRIPTS_DIR% -!define company "High Fidelity" -!define prodname "Interface" -!define exec "interface.exe" -!define icon "${srcdir}\interface.ico" -!define regkey "Software\${company}\${prodname}" -!define uninstkey "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}" +!define srcdir $%INSTALLER_SOURCE_DIR% +!define setup $%INSTALLER_NAME% +!define scriptsdir $%INSTALLER_SCRIPTS_DIR% +!define company $%INSTALLER_COMPANY% +!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\${company}" -!define install_dir_product "${install_dir_company}\${prodname}" !define startmenu_company "$SMPROGRAMS\${company}" -!define startmenu_product "${startmenu_company}\${prodname}" !define uninstaller "uninstall.exe" ;-------------------------------- @@ -22,8 +21,8 @@ XPStyle on ShowInstDetails hide ShowUninstDetails hide -Name "${prodname}" -Caption "${prodname}" +Name "${company}" +Caption "${company}" !ifdef icon Icon "${icon}" @@ -36,7 +35,7 @@ SetDatablockOptimize on CRCCheck on SilentInstall normal -InstallDir "${install_dir_product}" +InstallDir "${install_dir_company}" InstallDirRegKey HKLM "${regkey}" "" ; Page components @@ -88,35 +87,28 @@ Section "Registry Entries and Procotol Handler" SEC02 SectionIn RO WriteRegStr HKLM "${regkey}" "Install_Dir" "$INSTDIR" - WriteRegStr HKLM "${uninstkey}" "DisplayName" "${prodname} (remove only)" + WriteRegStr HKLM "${uninstkey}" "DisplayName" "${company} (remove only)" WriteRegStr HKLM "${uninstkey}" "UninstallString" '"$INSTDIR\${uninstaller}"' - WriteRegStr HKCR "${prodname}\Shell\open\command\" "" '"$INSTDIR\${exec} "%1"' - - !ifdef icon - WriteRegStr HKCR "${prodname}\DefaultIcon" "" "$INSTDIR\${icon}" - !endif + WriteRegStr HKCR "${company}\Shell\open\command\" "" '"$INSTDIR\${interface_exec} "%1"' + WriteRegStr HKCR "${company}\DefaultIcon" "" "$INSTDIR\${interface_icon}" ; hifi:// protocol handler registry entries WriteRegStr HKCR 'hifi' '' 'URL:Alert Protocol' WriteRegStr HKCR 'hifi' 'URL Protocol' '' - WriteRegStr HKCR 'hifi\DefaultIcon' '' '$INSTDIR\${icon},1' - WriteRegStr HKCR 'hifi\shell\open\command' '' '$INSTDIR\${exec} --url "%1"' + WriteRegStr HKCR 'hifi\DefaultIcon' '' '$INSTDIR\${interface_icon},1' + WriteRegStr HKCR 'hifi\shell\open\command' '' '$INSTDIR\${interface_exec} --url "%1"' SetOutPath $INSTDIR ; package all files, recursively, preserving attributes ; assume files are in the correct places File /r "${srcdir}\" - !ifdef icon - File /a "${icon}" - !endif + File /a "${srcdir}\${interface_icon}" + File /a "${srcdir}\${stack_manager_icon}" ; any application-specific files !ifdef files !include "${files}" !endif - SetOutPath "$DOCUMENTS\${company}\Scripts" - File /r "${scriptsdir}\" - SetOutPath $INSTDIR WriteUninstaller "${uninstaller}" Exec '"$INSTDIR\2013_vcredist_x64.exe" /q /norestart' Exec '"$INSTDIR\2010_vcredist_x86.exe" /q /norestart' @@ -129,24 +121,20 @@ Section "Start Menu Shortcuts" SEC03 ; This should install the shortcuts for "All Users" SetShellVarContext all - CreateDirectory "${startmenu_product}" + CreateDirectory "${startmenu_company}" SetOutPath $INSTDIR ; for working directory - !ifdef icon - CreateShortCut "${startmenu_product}\${prodname}.lnk" "$INSTDIR\${exec}" "" "$INSTDIR\${icon}" - !else - CreateShortCut "${startmenu_product}\${prodname}.lnk" "$INSTDIR\${exec}" - !endif - - CreateShortCut "${startmenu_product}\Uninstall ${prodname}.lnk" "$INSTDIR\${uninstaller}" + 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}" SectionEnd ; Uninstaller ; All section names prefixed by "Un" will be in the uninstaller -UninstallText "This will uninstall ${prodname}." +UninstallText "This will uninstall ${company}." !ifdef icon - UninstallIcon "${icon}" + UninstallIcon "${interface_icon}" !endif Section "Uninstall" SEC04 @@ -155,11 +143,10 @@ Section "Uninstall" SEC04 ; Explicitly remove all added shortcuts SetShellVarContext all - DELETE "${startmenu_product}\${prodname}.lnk" - DELETE "${startmenu_product}\Uninstall ${prodname}.lnk" + DELETE "${startmenu_company}\Interface.lnk" + DELETE "${startmenu_company}\Stack Manager.lnk" + DELETE "${startmenu_company}\Uninstall ${company}.lnk" - RMDIR "${startmenu_product}" - ; This should remove the High Fidelity folder in Start Menu if it's empty RMDIR "${startmenu_company}" RMDIR /r "$INSTDIR" From 66770cc907c654d03b01dd6dc3b5a294467955b8 Mon Sep 17 00:00:00 2001 From: Leonardo Murillo Date: Wed, 16 Dec 2015 16:11:35 -0600 Subject: [PATCH 6/8] Finishing touches --- CMakeLists.txt | 6 ++++-- cmake/macros/IncludeApplicationVersion.cmake | 17 +++++++++++++---- tools/nsis/release.nsi | 13 +++++++------ 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 69e6365c8c..ca3e381405 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -239,8 +239,10 @@ if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE) 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}/this-is-a-test.exe - COMMANE set INSTALLER_SCRIPTS_DIR=${CMAKE_SOURCE_DIR}/examples + 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 () \ No newline at end of file diff --git a/cmake/macros/IncludeApplicationVersion.cmake b/cmake/macros/IncludeApplicationVersion.cmake index a91aad6acc..753a12a01c 100644 --- a/cmake/macros/IncludeApplicationVersion.cmake +++ b/cmake/macros/IncludeApplicationVersion.cmake @@ -14,13 +14,22 @@ macro(INCLUDE_APPLICATION_VERSION) # We are relying on Jenkins defined environment variables to determine the origin of this build # and will only package if this is a PR or Release build if (DEFINED ENV{JOB_ID}) - set (DEPLOY_PACKAGE 1) - set (BUILD_SEQ $ENV{JOB_ID}) + set(DEPLOY_PACKAGE 1) + set(BUILD_SEQ $ENV{JOB_ID}) + set(INSTALLER_COMPANY "High Fidelity") + set(INSTALLER_DIRECTORY "${INSTALLER_COMPANY}") + set(INSTALLER_NAME "interface-win64-${BUILD_SEQ}.exe") elseif (DEFINED ENV{ghprbPullId}) - set (DEPLOY_PACKAGE 1) - set (BUILD_SEQ "PR-$ENV{ghprbPullId}") + set(DEPLOY_PACKAGE 1) + set(BUILD_SEQ "PR-$ENV{ghprbPullId}") + set(INSTALLER_COMPANY "High Fidelity - PR") + set(INSTALLER_DIRECTORY "${INSTALLER_COMPANY}\\${BUILD_SEQ}") + set(INSTALLER_NAME "pr-interface-win64-${BUILD_SEQ}.exe") else () set(BUILD_SEQ "dev") + set(INSTALLER_COMPANY "High Fidelity - Dev") + set(INSTALLER_DIRECTORY "${INSTALLER_COMPANY}") + set(INSTALLER_NAME "dev-interface-win64.exe") endif () configure_file("${MACRO_DIR}/ApplicationVersion.h.in" "${PROJECT_BINARY_DIR}/includes/ApplicationVersion.h") include_directories("${PROJECT_BINARY_DIR}/includes") diff --git a/tools/nsis/release.nsi b/tools/nsis/release.nsi index 86ea055e6b..9bc75e5274 100644 --- a/tools/nsis/release.nsi +++ b/tools/nsis/release.nsi @@ -1,18 +1,19 @@ !include LogicLib.nsh !include x64.nsh -!define srcdir $%INSTALLER_SOURCE_DIR% -!define setup $%INSTALLER_NAME% -!define scriptsdir $%INSTALLER_SCRIPTS_DIR% -!define company $%INSTALLER_COMPANY% +!define srcdir "$%INSTALLER_SOURCE_DIR%" +!define setup "$%INSTALLER_NAME%" +!define scriptsdir "$%INSTALLER_SCRIPTS_DIR%" +!define company "$%INSTALLER_COMPANY%" +!define install_directory "$%INSTALLER_DIRECTORY%" !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\${company}" -!define startmenu_company "$SMPROGRAMS\${company}" +!define install_dir_company "$PROGRAMFILES64\${install_directory}" +!define startmenu_company "$SMPROGRAMS\${install_directory}" !define uninstaller "uninstall.exe" ;-------------------------------- From a7b61cf791387695126b9da9a56233ab06ab170a Mon Sep 17 00:00:00 2001 From: Leonardo Murillo Date: Wed, 16 Dec 2015 16:39:09 -0600 Subject: [PATCH 7/8] Couple of fixes --- CMakeLists.txt | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca3e381405..13d5b2bc79 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.3.2) +cmake_minimum_required(VERSION 3.2) if (USE_ANDROID_TOOLCHAIN) set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/android/android.toolchain.cmake") @@ -228,21 +228,4 @@ if (HIFI_MEMORY_DEBUGGING) endif () include_application_version() - -if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE) - 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 () \ No newline at end of file +generate_installers() \ No newline at end of file From bbe444ffc1a4833f7b4bab49d81d02a02494782c Mon Sep 17 00:00:00 2001 From: Leonardo Murillo Date: Wed, 16 Dec 2015 16:40:51 -0600 Subject: [PATCH 8/8] Forgot to add file --- cmake/macros/GenerateInstallers.cmake | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 cmake/macros/GenerateInstallers.cmake diff --git a/cmake/macros/GenerateInstallers.cmake b/cmake/macros/GenerateInstallers.cmake new file mode 100644 index 0000000000..570e24332b --- /dev/null +++ b/cmake/macros/GenerateInstallers.cmake @@ -0,0 +1,30 @@ +# +# 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 () +endmacro() \ No newline at end of file