mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Adding AppVeyor setup type
This commit is contained in:
parent
2d9d98ad35
commit
0b9d7e43a6
2 changed files with 65 additions and 6 deletions
|
@ -27,6 +27,7 @@ You should have received a copy of the GNU General Public License
|
|||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
|
||||
namespace ShareX.Setup
|
||||
{
|
||||
|
@ -39,10 +40,11 @@ private enum SetupType
|
|||
CreatePortable, // Create portable zip file
|
||||
PortableApps, // Create PortableApps folder
|
||||
Beta, // Build setup & upload it using "Debug/ShareX.exe"
|
||||
Steam // Create Steam folder
|
||||
Steam, // Create Steam folder
|
||||
AppVeyor
|
||||
}
|
||||
|
||||
private static readonly SetupType Setup = SetupType.Stable;
|
||||
private static SetupType Setup = SetupType.Stable;
|
||||
|
||||
private static readonly string parentDir = @"..\..\..\";
|
||||
private static readonly string binDir = Path.Combine(parentDir, "ShareX", "bin");
|
||||
|
@ -66,6 +68,13 @@ private enum SetupType
|
|||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("ShareX.Setup started.");
|
||||
|
||||
if (CheckArgs(args, "-appveyor"))
|
||||
{
|
||||
Setup = SetupType.AppVeyor;
|
||||
}
|
||||
|
||||
Console.WriteLine("Setup type: " + Setup);
|
||||
|
||||
switch (Setup)
|
||||
|
@ -95,9 +104,28 @@ private static void Main(string[] args)
|
|||
CreateSteamFolder();
|
||||
OpenOutputDirectory();
|
||||
break;
|
||||
case SetupType.AppVeyor:
|
||||
CompileSetup();
|
||||
break;
|
||||
}
|
||||
|
||||
Console.WriteLine("Done.");
|
||||
Console.WriteLine("ShareX.Setup successfully completed.");
|
||||
}
|
||||
|
||||
private static bool CheckArgs(string[] args, string check)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(check))
|
||||
{
|
||||
foreach (string arg in args)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(arg) && arg.Equals(check, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void OpenOutputDirectory()
|
||||
|
@ -117,9 +145,37 @@ private static void UploadLatestFile()
|
|||
|
||||
private static void CompileSetup()
|
||||
{
|
||||
Console.WriteLine("Compiling setup...");
|
||||
Process.Start(innoSetupCompilerPath, string.Format("\"{0}\"", innoSetupScriptPath)).WaitForExit();
|
||||
Console.WriteLine("Setup file created.");
|
||||
if (Setup == SetupType.AppVeyor && !File.Exists(innoSetupCompilerPath))
|
||||
{
|
||||
Console.WriteLine("Downloading InnoSetup.");
|
||||
|
||||
string innoSetupURL = "http://files.jrsoftware.org/is/5/innosetup-5.5.9-unicode.exe";
|
||||
string innoSetupFilename = "innosetup-5.5.9-unicode.exe";
|
||||
|
||||
using (WebClient webClient = new WebClient())
|
||||
{
|
||||
webClient.DownloadFile(innoSetupURL, innoSetupFilename);
|
||||
}
|
||||
|
||||
Console.WriteLine("Installing InnoSetup...");
|
||||
|
||||
Process.Start(innoSetupFilename, "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-").WaitForExit();
|
||||
|
||||
Console.WriteLine("InnoSetup installed.");
|
||||
}
|
||||
|
||||
if (File.Exists(innoSetupCompilerPath))
|
||||
{
|
||||
Console.WriteLine("Compiling setup file.");
|
||||
|
||||
Process.Start(innoSetupCompilerPath, $"\"{innoSetupScriptPath}\"").WaitForExit();
|
||||
|
||||
Console.WriteLine("Setup file is created: " + innoSetupScriptPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("InnoSetup compiler is missing: " + innoSetupCompilerPath);
|
||||
}
|
||||
}
|
||||
|
||||
private static void CreateSteamFolder()
|
||||
|
|
|
@ -86,8 +86,11 @@ Global
|
|||
{D13441B6-96E1-4D1B-8A95-58A7D6CB1E24}.Steam|Any CPU.ActiveCfg = Steam|Any CPU
|
||||
{D13441B6-96E1-4D1B-8A95-58A7D6CB1E24}.Steam|Any CPU.Build.0 = Steam|Any CPU
|
||||
{3D19A94A-7A58-4451-A686-EE70B471C206}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3D19A94A-7A58-4451-A686-EE70B471C206}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3D19A94A-7A58-4451-A686-EE70B471C206}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3D19A94A-7A58-4451-A686-EE70B471C206}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3D19A94A-7A58-4451-A686-EE70B471C206}.Steam|Any CPU.ActiveCfg = Steam|Any CPU
|
||||
{3D19A94A-7A58-4451-A686-EE70B471C206}.Steam|Any CPU.Build.0 = Steam|Any CPU
|
||||
{1A190E53-1419-4CC2-B0E5-3BC7EA861C8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1A190E53-1419-4CC2-B0E5-3BC7EA861C8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1A190E53-1419-4CC2-B0E5-3BC7EA861C8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
|
|
Loading…
Reference in a new issue