CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
HTTPS supported installation function
The following APIs supports HTTP and HTTPS.
Please refer to the examples below to see how to use these functions.
  • CRI File System Basic samples Scene 07
  • CRI File System Advanced samples Scene 01
Attention
When using these functions on iOS, iOS 7 or later is required.

Initialization

In any of cases, you need initialize with CriWare.CriFsWebInstaller.InitializeModule function.
When you are done, call CriWare.CriFsWebInstaller.FinalizeModule function.
CriFsWebInstaller.ModuleConfig moduleConfig = CriFsWebInstaller.defaultModuleConfig;
moduleConfig.numInstallers = 3; // Increase from default 2 to 3
moduleConfig.inactiveTimeoutSec = 60;
CriFsWebInstaller.InitializeModule(moduleConfig();
Attention
The initialization value of the CriWareInitalizer component is not used.
The maximum number of simultaneous installation requests is adjusted in CriFsWebInstaller.ModuleConfig.numInstallers.

Transition from CriFsInstaller

If you are currently using the CriWare.CriFsInstaller class, please replace it with the CriWare.CriFsWebInstaller class.
The basic API specifications are almost the same, but please note the following points.
Attention:
  • Initialization is necessary.
  • If CriFsInstaller connects to the server once, it performs infinite retries internally and does not time out.
    On the other hand, CriFsWebInstaller times out (at the time specified during initialization).
  • Replace CriFsInstaller.GetStatus() and CriFsInstaller.GetProgress() with CriFsWebInstaller.GetStatusInfo().
  • CriFsWebInstaller cannot use CriFsBinder when copying.
  • CriFsInstaller overwrites files that are already installed. CriFsWebInstaller will not overwrite and an error will result.
    Please delete the file with the application beforehand if necessary.
  • The ways to make an HTTP request differ between CriFsInstaller and CriFsWebInstaller.
Additional specification:
  • Error information can be retrieved by CriFsWebInstaller::GetStatusInfo function.
  • The progress status of CriFsInstaller has changed with the CriWareIntializer component's installBufferSize, but CriFsWebInstaller does not depend on it and the progress status in bytes can be obtained.

Transition from CriFsUtility.Install()

If you are currently installing using CriWare.CriFsUtility.Install(), replace it with CriWare.CriFsUtility.WebInstall().
The basic API specifications are almost the same, but please note the following points.
Attention:
  • Initialization is necessary.
  • If CriFsUtility.Install() connects to the server once, it performs infinite retries internally and does not time out.
    On the other hand, CriWare.CriFsUtility.WebInstall() times out (at the time specified during initialization).
  • CriFsUtility.WebInstall() cannot use CriFsBinder when copying.
  • The ways to make an HTTP request differ between CriFsUtility.Install() and CriFsUtility.WebInstall().
Additional specification:
  • The progress status of CriFsUtility.Install() has changed with the CriWareIntializer component's installBufferSize, but CriFsUtility.WebInstall() does not depend on it and the progress status in bytes can be obtained.
Note:
  • To maintain compatibility with CriFsUtility.Install() functions, CriFsUtility.WebInstall() automatically deletes files if they already exist.
  • CriFsUtility.Install() cannot copy files between local storages. Please useCriFsUtility.Install().

About internal error retry

In the following cases, a retry is performed internally.
  • The network connection has ended prematurely
  • The Internet connection has expired
If the connection cannot be restarted even after the timeout period specified during initialization, a timeout error occurs.
Like with CriFsInstaller and CriFsUtility.Install(), if you cannot connect to the Internet at the start of the installation, you will get an error immediately without retrying.
In the same way, in case of HTTP errors such as 404 or 504, a retry is not performed internally.
As the CriFsWebInstaller class can now acquire the error cause and HTTP status code, please perform the error handling according to your application requirements.
However, CriFsUtility.WebInstall() cannot acquire such detailed information. Therefore, please use the CriFsWebInstaller class if you want to provide more detailed error handling.