From 42a6f9daa1d7fbe4913f18c20c527c6b9104df0a Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 19 Jan 2016 09:33:06 -0800 Subject: [PATCH] hard code the matching app data path --- cmake/templates/CPackProperties.cmake.in | 2 ++ cmake/templates/NSIS.template.in | 15 +++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/cmake/templates/CPackProperties.cmake.in b/cmake/templates/CPackProperties.cmake.in index 7b3d0ae53e..08b23f4657 100644 --- a/cmake/templates/CPackProperties.cmake.in +++ b/cmake/templates/CPackProperties.cmake.in @@ -19,6 +19,8 @@ set(HIGH_FIDELITY_PROTOCOL "@HIGH_FIDELITY_PROTOCOL@") set(PRODUCTION_BUILD "@PRODUCTION_BUILD@") set(PR_BUILD "@PR_BUILD@") set(BUILD_ORGANIZATION "@BUILD_ORGANIZATION@") +set(APP_DATA_ROOT "@APP_DATA_ROOT@") +set(APP_DATA_PATH "@APP_DATA_ROOT@/@BUILD_ORGANIZATION@") set(POST_INSTALL_OPTIONS_PATH "@POST_INSTALL_OPTIONS_PATH@") set(CLIENT_COMPONENT_NAME "@CLIENT_COMPONENT@") set(SERVER_COMPONENT_NAME "@SERVER_COMPONENT@") diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index 6063ab475c..d7cc3f715c 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -977,15 +977,18 @@ Function HandlePostInstallOptions ${If} $CopyFromProductionState == ${BST_CHECKED} ; we need to copy whatever is in the data folder for production build to the data folder for this build - CreateDirectory "$APPDATA\@BUILD_ORGANIZATION@" + CreateDirectory "@APP_DATA_PATH@" - IfErrors CopyData + ; copy the data from production build to this PR build + CopyFiles "@APP_DATA_ROOT@\High Fidelity\*" "@APP_DATA_PATH@" - ; if we're here there was an error creating the data folder for this build - MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "Could not create directory $APPDATA\@BUILD_ORGANIZATION@, error $0" + ; handle an error in copying files + IfError 0 NoError - CopyData: - CopyFiles "$APPDATA\High Fidelity\*" "$APPDATA\@BUILD_ORGANIZATION@" + MessageBox mb_IconStop|mb_TopMost|mb_SetForeground \ + "There was a problem copying your production content and settings to @APP_DATA_PATH@ for this PR build.$\r$\nPlease try to copy them manually." + + NoError: ${EndIf} ${EndIf}