A game about forced loneliness, made by TACStudios
1using System.IO;
2using Codice.Client.Common;
3using Codice.Utils;
4
5namespace Unity.PlasticSCM.Editor.Views.Welcome
6{
7 class MacOSConfigWorkaround
8 {
9 /* In macOS there is no way to pass a parameter
10 * to the PKG installer to avoid launching
11 * Plastic at the end of the installation process.
12
13 * As a workaround, we can create an empty client.conf in
14 * the user config folder. This way the installer skips
15 * launching Plastic at the end of the installation process.
16
17 * see /01plastic/install/mac/macplastic/Scripts/postinstall
18
19 * Then, we delete the client.conf file if we created it */
20
21 internal void CreateClientConfigIfNeeded()
22 {
23 if (!PlatformIdentifier.IsMac())
24 return;
25
26 string clientConfFile = ConfigFileLocation.GetConfigFilePath(
27 ClientConfig.CLIENT_CONFIG_FILE_NAME);
28
29 if (File.Exists(clientConfFile))
30 return;
31
32 File.Create(clientConfFile).Close();
33 mClientConfigCreated = true;
34 }
35
36 internal void DeleteClientConfigIfNeeded()
37 {
38 if (!mClientConfigCreated)
39 return;
40
41 string clientConfFile = ConfigFileLocation.GetConfigFilePath(
42 ClientConfig.CLIENT_CONFIG_FILE_NAME);
43
44 File.Delete(clientConfFile);
45 }
46
47 bool mClientConfigCreated;
48 }
49}