Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/contentSets/*
!/contentSets/README.md
!/contentSets/example/example.zip
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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\<protocol>\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)_
Expand Down Expand Up @@ -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 <content_set_dir> --scripts <content_set_dir>\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 <content_set_dir> --scripts <content_set_dir>\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
Expand Down
48 changes: 48 additions & 0 deletions contentSets/README.md
Original file line number Diff line number Diff line change
@@ -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
```
<light-installer>/contentSets
|__<Content Set Name>
|__data8/
|__<See the "data8" section below>
|__ktx_cache/
|__<See the "ktx_cache" section below>
|__scripts/
|__<See the "scripts" section below>
```

### `data8`
The contents of this folder should be a direct copy of the contents of the `data8` cache folder found in `C:/Users/<username>/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/<username>/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/<username>/AppData/Local/High Fidelity/Interface/data8` to `<light-installer>/contentSets/data8/`
6. Copy the contents of `C:/Users/<username>/AppData/Local/High Fidelity/Interface/ktx_cache` to `<light-installer>/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 `<light-installer>/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!
Binary file added contentSets/example/example.zip
Binary file not shown.
Binary file added installer/High Fidelity - WWW.exe
Binary file not shown.
Binary file modified installer/High Fidelity JimJamz Event.exe
Binary file not shown.
90 changes: 53 additions & 37 deletions installer/hifi_light.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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."
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -581,31 +606,22 @@
; 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}
SendMessage $HWNDPARENT ${WM_COMMAND} 2 0 ; Click the "Finish" button
Quit
FunctionEnd
;--------------------------------
; END Step 4
; END Step 5
;--------------------------------

;--------------------------------
Expand Down
Binary file added installer/icons/lilypad.ico
Binary file not shown.
Binary file modified installer/images/hifi1.bmp
Binary file not shown.
3 changes: 3 additions & 0 deletions installer/resources/Interface.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"firstRun": false
}