diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fa79499 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/contentSets/* +!/contentSets/README.md +!/contentSets/example/example.zip \ No newline at end of file diff --git a/README.md b/README.md index e355c75..facc9d0 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,11 @@ A light installer for High Fidelity VR. Built using NSIS. - [NSIS Inetc Plugin](http://nsis.sourceforge.net/Inetc_plug-in) ## Current "High Fidelity Express" Installer Flow -_This section of the README is current as of **2017-06-26 1:30 PM PDT**. It'll be updated as the installer logic matures._ +_This section of the README is current as of **2019-04-17 5:00 PM PDT**. It'll be updated as the installer logic matures._ -When a user runs `High Fidelity Jaws Event.exe`, the following behavior occurs: +When a user runs `High Fidelity - WWW.exe`, the following behavior occurs: 1. We **ask for administrator permissions** so that it can perform various operations (like reading from the registry and creating files). -2. We **copy the Jaws Event installer EXE file to `%AppData%\High Fidelity\Jaws\High Fidelity Jaws Event.exe`, then create shortcuts to that file on the desktop and in the Start menu. +2. We **copy the WWW installer EXE file** to `%AppData%\High Fidelity\WWW\High Fidelity - WWW.exe`, then create shortcuts to that file on the desktop and in the Start menu. 3. We **verify that the "correct" version of High Fidelity Interface is installed** on the user's computer. 1. We read from the registry at `HKEY_CLASSES_ROOT\hifi\DefaultIcon` to **determine the path of `interface.exe`** that the user installed most recently - _(FYI: `HKCR\\shell\open\command\(Default)` is where the registry keys go that determine what to do when you click on, say, a `hifi://` or `itunes://` link)_ @@ -42,8 +42,13 @@ When a user runs `High Fidelity Jaws Event.exe`, the following behavior occurs: 3. Once the full High Fidelity Interface installer completes, **the light installer will re-verify** that the correct version of Interface is installed on the system. 1. If, at this point, the correct version of Interface is not installed, the light installer will fail and instruct the user to restart the light installer. 2. If the correct version of Interface _is_ installed, we continue. -6. We, again determine the (possibly new) path of `interface.exe`, then **run `interface.exe` using the following command: `interface.exe --url hifi://dev-playa/event --suppress-settings-reset --skipTutorial --cache --scripts \scripts`**. - - _The cache part doesn't work yet, so we're not yet getting that acceleration. But that's Interface issue, not a micro-installer issue._ +6. We **check if an `Interface.json` file exists in the user's `AppData\Interface\` directory**: + 1. If the user already has an `Interface.json` file on their hard drive: + 1. We continue onto the next step. + 2. If the user _does not_ already have an `Interface.json` file on their hard drive: + 1. We download a "starter" Settings file from S3 and place it in the user's `AppData\Interface\` directory. Right now, that file only contains `{"firstRun": false}`. + 2. We continue onto the next step. +6. We, again determine the (possibly new) path of `interface.exe`, then **run `interface.exe` using the following command: `interface.exe --url hifi://www --suppress-settings-reset --cache --scripts \scripts`**. - Now that the user has gotten this far in the installer, the path to `interface.exe` _should be_ either the one installed by the installer in the steps above, OR the path the installer verified to be up-to-date enough for the event. ## Cumulative Test Plan diff --git a/contentSets/README.md b/contentSets/README.md new file mode 100644 index 0000000..1e9ed8d --- /dev/null +++ b/contentSets/README.md @@ -0,0 +1,48 @@ +# The `/contentSets` Folder +The contents of this folder will be ignored by Git, _except_ for `example/example.zip`. Unzip the contents of that folder somewhere, and use it as a starting point for your content sets. + +Create a new folder within the `contentSets` folder, then use your new folder as a sandbox for developing your custom content sets to be used with the Light Installer. + +Once you have a custom content set, ZIP up the three populated folders and their contents, then upload that ZIP file to a remote host. After that, modify variables `hifi_light.nsi` as necessary and compile your installer. + +## Custom Content Set Folder Structure +``` +/contentSets +|__ + |__data8/ + |__ + |__ktx_cache/ + |__ + |__scripts/ + |__ +``` + +### `data8` +The contents of this folder should be a direct copy of the contents of the `data8` cache folder found in `C:/Users//AppData/Local/High Fidelity/Interface/data8`. + +For instructions about correctly populating this folder, see the "Correctly Populating the `data8` and `ktx_cache` Folders" section below. + +### `ktx_cache` +The contents of this folder should be a direct copy of the contents of the `data8` cache folder found in `C:/Users//AppData/Local/High Fidelity/Interface/ktx_cache`. + +For instructions about correctly populating this folder, see the "Correctly Populating the `data8` and `ktx_cache` Folders" section below. + +### Correctly Populating the `data8` and `ktx_cache` Folders +To correctly populate the `data8` and `ktx_cache` folders inside your custom content set's folder: +1. Open Interface +2. Navigate to the domain whose data you'd like to cache +3. Click `Edit` -> `Reload Content (Clears all caches)` +4. Fly around the domain so that your system caches all of the content. +5. Copy the contents of `C:/Users//AppData/Local/High Fidelity/Interface/data8` to `/contentSets/data8/` +6. Copy the contents of `C:/Users//AppData/Local/High Fidelity/Interface/ktx_cache` to `/contentSets/ktx_cache/` + +### `scripts` +The contents of this folder should contain a `defaultScripts.js` file, which Interface will read when it is launched from the Light Installer. + +For an example `defaultScripts.js` file, open `/contentSets/example/scripts/defaultScripts.js`. That example `defaultScripts.js` file looks very similar to the RC81 `defaultScripts.js` file, with the following changes: + - An inclusion of an uncertified copy of the Appreciate v1.5 app. + - The removal of the Interstitial Mode scripts, regardless of the user's `Window.interstitialModeEnabled` setting. + +Follow that example's patterns when creating your custom set of default scripts. + +Make sure to copy the scripts you reference in your `defaultScripts.js` file into the `scripts` custom content directory! \ No newline at end of file diff --git a/contentSets/example/example.zip b/contentSets/example/example.zip new file mode 100644 index 0000000..7a25ae4 Binary files /dev/null and b/contentSets/example/example.zip differ diff --git a/installer/High Fidelity - WWW.exe b/installer/High Fidelity - WWW.exe new file mode 100644 index 0000000..92a4ef4 Binary files /dev/null and b/installer/High Fidelity - WWW.exe differ diff --git a/installer/High Fidelity JimJamz Event.exe b/installer/High Fidelity JimJamz Event.exe index c90d301..fc79786 100644 Binary files a/installer/High Fidelity JimJamz Event.exe and b/installer/High Fidelity JimJamz Event.exe differ diff --git a/installer/hifi_light.nsi b/installer/hifi_light.nsi index d6efe9c..1b55334 100644 --- a/installer/hifi_light.nsi +++ b/installer/hifi_light.nsi @@ -219,8 +219,8 @@ ; START General ;-------------------------------- ; Event Name - !define EVENT_NAME "JimJamz" - !define INSTALLER_APPLICATION_NAME "High Fidelity ${EVENT_NAME} Event" + !define EVENT_NAME "WWW" + !define INSTALLER_APPLICATION_NAME "High Fidelity - ${EVENT_NAME}" ; Installer application name Name "${INSTALLER_APPLICATION_NAME}" @@ -229,11 +229,11 @@ !define EXE_NAME "${INSTALLER_APPLICATION_NAME}.exe" OutFile "${EXE_NAME}" - !define MUI_ICON "icons\jimjamz.ico" + !define MUI_ICON "icons\lilypad.ico" !define MUI_HEADERIMAGE !define MUI_HEADERIMAGE_BITMAP "icons\installer-header.bmp" - !define HIFI_PROTOCOL_VERSION "vNTlzyZbPVfAprVzet07vA==" - !define HIFI_MAIN_INSTALLER_URL "http://highfidelity.com/download/win/6810" + !define HIFI_PROTOCOL_VERSION "qrWjtWV1dW/rkkeWcvoIuw==" + !define HIFI_MAIN_INSTALLER_URL "https://builds.highfidelity.com/HighFidelity-Beta-Interface-latest.exe" ;;!define HIFI_MAIN_INSTALLER_URL "https://deployment.highfidelity.com/jobs/pr-build/label%3Dwindows/1042/HighFidelity-Beta-PR10794-e5666fbb2f9e0e7fa403cb3eafc74a386e253597.exe" ; Small test exe for testing/debugging. ;!define HIFI_MAIN_INSTALLER_URL "https://s3-us-west-1.amazonaws.com/hifi-content/zfox/Personal/test.exe" @@ -243,10 +243,9 @@ ;; 2. make sure that some older NON-PR build is already installed (such as an older release). This puts an entry in the registry so we don't fail when checking. ;; 3. If steam is the latest, or if the old installation has a non-default install pathname, you're screwed. !define PR_BUILD_DIRECTORY "" ;; example: "High Fidelity - PR10794" - !define EVENT_LOCATION "hifi://JimJamz" - !define CONTENT_ID "jimjamz-1" - !define CONTENT_SET "http://cdn.highfidelity.com/content-sets/zaru-content-custom-scripts.zip" - !define MORPH_AVATAR_FILE "$AppData\..\LocalLow\Morph3D\ReadyRoom\High_Fidelity_RR_Launch.js" + !define EVENT_LOCATION "hifi://www" + !define CONTENT_ID "www-1" + !define CONTENT_SET "https://hifi-content.s3.amazonaws.com/zfox/light-installer/content-sets/www.zip" ; Request Administrator privileges for Windows Vista and higher @@ -269,14 +268,11 @@ ;-------------------------------- ; START Installer Sections ;-------------------------------- - !define INCLUDE_DOWNLOAD_CONTENT_STEP "false" Section "LightInstaller" LightInstaller Call MaybeDownloadHiFi - ${If} ${INCLUDE_DOWNLOAD_CONTENT_STEP} == "true" - Call MaybeDownloadContent - ${EndIf} + Call MaybeDownloadContent Call MaybeInstallHiFi - Call LaunchInterface + Call MaybeCopySettingsAndLaunch SectionEnd ;-------------------------------- ; END Installer Sections @@ -310,9 +306,9 @@ !define VERSIONMAJOR 1 !define VERSIONMINOR 0 !define VERSIONBUILD 0 - !define HELPURL "http://highfidelity.com" ; "Support Information" link - !define UPDATEURL "http://highfidelity.com" ; "Product Updates" link - !define ABOUTURL "http://highfidelity.com" ; "Publisher" link + !define HELPURL "https://highfidelity.com" ; "Support Information" link + !define UPDATEURL "https://highfidelity.com" ; "Product Updates" link + !define ABOUTURL "https://highfidelity.com" ; "Publisher" link !define INSTALLSIZE 1024 ; In kB; just a guess Function SetupUninstaller writeUninstaller "$AppData\High Fidelity\${EVENT_NAME}\Uninstall ${EXE_NAME}" @@ -407,7 +403,7 @@ Goto interface_not_found installed_from_steam: MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION \ - "You have an old version of High Fidelity installed through Steam.$\r$\nPlease update High Fidelity through Steam, then press Retry.$\r$\nTo quit this installer, press Cancel.$\r$\n$\r$\nNOTE: During debugging, while the Steam version of HiFi is out-of-date, you will get stuck here, as no version of HiFi is up-to-date enough to work with this installer." \ + "You have an old version of High Fidelity installed through Steam.$\r$\nPlease update High Fidelity through Steam, then press Retry.$\r$\nTo quit this installer, press Cancel." \ /SD IDCANCEL IDRETRY +3 IDCANCEL 0 ${nsProcess::Unload} Quit @@ -461,7 +457,8 @@ MessageBox MB_OK "Content download failed with status: $R0. Please try running this installer again." ${nsProcess::Unload} Quit - nsisunz::Unzip "$DownloadedFilePath_Content" "${ContentPath}" + ;MessageBox MB_OK "Custom content downloaded to $TEMP\hifi_content.zip" + nsisunz::Unzip "$DownloadedFilePath_Content" "${ContentPath}\Interface" Pop $R0 StrCmp $R0 "success" EventSpecificContent_finish MessageBox MB_OK "Content set decompression failed with status: $R0. Please try running this installer again." @@ -508,7 +505,7 @@ ; when the user presses this button. GetDlgItem $R0 $HWNDPARENT 2 SendMessage $R0 ${WM_SETTEXT} 0 "STR:Finish" - Call LaunchInterface + Call MaybeCopySettingsAndLaunch ${EndIf} ${EndIf} FunctionEnd @@ -566,10 +563,38 @@ ;-------------------------------- ; END Step 3 ;-------------------------------- - + ;-------------------------------- ; START Step 4: ; Launch Interface with command-line arguments +;-------------------------------- + !define SETTINGS_FILE "$AppData\High Fidelity\Interface.json" + !define STARTER_SETTINGS_FILE "https://hifi-content.s3.amazonaws.com/zfox/light-installer/resources/Interface.json" + Function MaybeCopySettingsAndLaunch + IfFileExists "${SETTINGS_FILE}" settings_file_found settings_file_not_found + settings_file_found: + ;MessageBox MB_OK "Settings file found!" + Goto SettingsFileCheck_finish + settings_file_not_found: + ;MessageBox MB_OK "Settings file NOT found! Downloading from ${STARTER_SETTINGS_FILE} to ${SETTINGS_FILE}" + inetc::get "${STARTER_SETTINGS_FILE}" "${SETTINGS_FILE}" + Pop $R0 ; Get the download process return value + StrCmp $R0 "OK" +4 + MessageBox MB_OK "Settings file download failed with status: $R0. Please try running this installer again." + ${nsProcess::Unload} + Quit + ;MessageBox MB_OK "Starter settings file downloaded to ${SETTINGS_FILE}" + Goto SettingsFileCheck_finish + SettingsFileCheck_finish: + Call LaunchInterface + FunctionEnd +;-------------------------------- +; END Step 4 +;-------------------------------- + +;-------------------------------- +; START Step 5: +; Launch Interface with command-line arguments ;-------------------------------- Var InterfaceCommandArgs @@ -581,23 +606,14 @@ ; Make sure that no High Fidelity application is already running !insertmacro CheckForRunningApplications Call GetInterfacePath ;; In case it changed during installation of a new version - ;StrCpy $InterfaceCommandArgs '--url "${EVENT_LOCATION}" --suppress-settings-reset --skipTutorial --cache "${ContentPath}\Interface" --scripts "${ContentPath}\Interface\scripts"' - ; The released version of Interface crashes when you supply the "--cache" switch. - ; For JimJamz, we want to use the default set of scripts. - ; Because of the above, omit the "--cache" and "--scripts" switches. - StrCpy $InterfaceCommandArgs '--url "${EVENT_LOCATION}" --suppress-settings-reset --skipTutorial' + ; In the past, Interface crashed when it was launched with the "--cache" switch. + ; For previous events, we wanted to use the default set of scripts. + ; Because of the above, we omit the "--cache" and "--scripts" switches in the line below. + ;StrCpy $InterfaceCommandArgs '--url "${EVENT_LOCATION}" --suppress-settings-reset' + ; Use the line below to launch Interface with the specified cache and scripts directories. + StrCpy $InterfaceCommandArgs '--url "${EVENT_LOCATION}" --suppress-settings-reset --cache "${ContentPath}\Interface" --scripts "${ContentPath}\Interface\scripts"' - ; Demonstrate that we can pick up the beta RR avatar from file. - IfFileExists "${MORPH_AVATAR_FILE}" ParseRRScript NoRRScript - ParseRRScript: - ${LineRead} "${MORPH_AVATAR_FILE}" "4" $R0 - ${WordFind2X} "$R0" 'var rrURL = "' '";' "+1" $R1 - ${IfNot} $R1 == $R0 - StrCpy $InterfaceCommandArgs '$InterfaceCommandArgs --avatarURL "$R1"' - ${EndIf} - NoRRScript: - Exec '"$InterfacePath" $InterfaceCommandArgs' ${EndIf} ${nsProcess::Unload} @@ -605,7 +621,7 @@ Quit FunctionEnd ;-------------------------------- -; END Step 4 +; END Step 5 ;-------------------------------- ;-------------------------------- diff --git a/installer/icons/lilypad.ico b/installer/icons/lilypad.ico new file mode 100644 index 0000000..b9de25a Binary files /dev/null and b/installer/icons/lilypad.ico differ diff --git a/installer/images/hifi1.bmp b/installer/images/hifi1.bmp index c43104f..f24fccc 100644 Binary files a/installer/images/hifi1.bmp and b/installer/images/hifi1.bmp differ diff --git a/installer/resources/Interface.json b/installer/resources/Interface.json new file mode 100644 index 0000000..3b0353d --- /dev/null +++ b/installer/resources/Interface.json @@ -0,0 +1,3 @@ +{ + "firstRun": false +}