-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathIInstallerPlatform.cs
More file actions
117 lines (98 loc) · 3.92 KB
/
IInstallerPlatform.cs
File metadata and controls
117 lines (98 loc) · 3.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace sttz.InstallUnity
{
/// <summary>
/// Class representing an existing Unity installation.
/// </summary>
public class Installation
{
/// <summary>
/// Path to the Unity installation root.
/// </summary>
public string path;
/// <summary>
/// Path to the Unity executable.
/// </summary>
public string executable;
/// <summary>
/// Version of the installation.
/// </summary>
public UnityVersion version;
}
/// <summary>
/// Interface for the platform-specific installer implementation.
/// </summary>
public interface IInstallerPlatform
{
/// <summary>
/// The platform that should be used by default.
/// </summary>
Task<CachePlatform> GetCurrentPlatform();
/// <summary>
/// Get platforms that can be installed on the current platform.
/// </summary>
Task<IEnumerable<CachePlatform>> GetInstallablePlatforms();
/// <summary>
/// The path to the file where settings are stored.
/// </summary>
string GetConfigurationDirectory();
/// <summary>
/// The directory where cache files are stored.
/// </summary>
string GetCacheDirectory();
/// <summary>
/// The directory where downloaded files are temporarily stored.
/// </summary>
string GetDownloadDirectory();
/// <summary>
/// Check wether the user is admin when installing.
/// </summary>
Task<bool> IsAdmin(CancellationToken cancellation = default);
/// <summary>
/// Prompt for the admin password if it's necessary to install Unity.
/// </summary>
/// <returns>If the password was acquired successfully</returns>
Task<bool> PromptForPasswordIfNecessary(CancellationToken cancellation = default);
/// <summary>
/// Find all existing Unity installations.
/// </summary>
Task<IEnumerable<Installation>> FindInstallations(CancellationToken cancellation = default);
/// <summary>
/// Move an existing Unity installation.
/// </summary>
Task MoveInstallation(Installation installation, string newPath, CancellationToken cancellation = default);
/// <summary>
/// Prepare to install the given version of Unity.
/// </summary>
/// <param name="queue">The installation queue to prepare</param>
/// <param name="installationPaths">Paths to try to move the installation to (see <see cref="Configuration.installPathMac"/>)</param>
/// <param name="cancellation">Cancellation token</param>
Task PrepareInstall(UnityInstaller.Queue queue, string installationPaths, CancellationToken cancellation = default);
/// <summary>
/// Install a package (<see cref="PrepareInstall"/> has to be called first).
/// </summary>
/// <param name="queue">The installation queue</param>
/// <param name="item">The queue item to install</param>
/// <param name="cancellation">Cancellation token</param>
/// <returns></returns>
Task Install(UnityInstaller.Queue queue, UnityInstaller.QueueItem item, CancellationToken cancellation = default);
/// <summary>
/// Complete an installation after all packages have been installed.
/// </summary>
/// <param name="cancellation">Cancellation token</param>
Task<Installation> CompleteInstall(bool aborted, CancellationToken cancellation = default);
/// <summary>
/// Uninstall a Unity installation.
/// </summary>
Task Uninstall(Installation installation, CancellationToken cancellation = default);
/// <summary>
/// Run a Unity installation with the given arguments.
/// </summary>
/// <param name="installation">Unity installation to run</param>
/// <param name="arguments">Arguments to pass to Unity</param>
/// <param name="child">Wether to run Unity as a child process and forward its standard input/error and log</param>
Task Run(Installation installation, IEnumerable<string> arguments, bool child);
}
}