mirror of
https://github.com/Ylianst/MeshCentralRouter
synced 2025-12-11 05:43:45 +00:00
Fixed customization path.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.Reflection;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace MeshCentralRouter
|
namespace MeshCentralRouter
|
||||||
@@ -12,9 +13,10 @@ namespace MeshCentralRouter
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
// Load customizations
|
// Load customizations
|
||||||
try { pictureBox1.Image = (Bitmap)Image.FromFile(@"customization\install.png"); } catch (Exception) { }
|
FileInfo selfExe = new FileInfo(Assembly.GetExecutingAssembly().Location);
|
||||||
|
try { pictureBox1.Image = (Bitmap)Image.FromFile(Path.Combine(selfExe.Directory.FullName, @"customization\install.png")); } catch (Exception) { }
|
||||||
try {
|
try {
|
||||||
string[] lines = File.ReadAllLines(@"customization\customize.txt");
|
string[] lines = File.ReadAllLines(Path.Combine(selfExe.Directory.FullName, @"customization\customize.txt"));
|
||||||
if (lines[2] != "") { groupBox1.Text = lines[2]; }
|
if (lines[2] != "") { groupBox1.Text = lines[2]; }
|
||||||
if (lines[3] != "") { label1.Text = lines[3]; }
|
if (lines[3] != "") { label1.Text = lines[3]; }
|
||||||
} catch (Exception) { }
|
} catch (Exception) { }
|
||||||
|
|||||||
@@ -254,13 +254,14 @@ namespace MeshCentralRouter
|
|||||||
|
|
||||||
// Load customizations
|
// Load customizations
|
||||||
bool showLicense = true;
|
bool showLicense = true;
|
||||||
try { pictureBox1.Image = (Bitmap)Image.FromFile(@"customization\topbanner.png"); showLicense = false; } catch (Exception) { }
|
FileInfo selfExe = new FileInfo(Assembly.GetExecutingAssembly().Location);
|
||||||
try { pictureBox2.Image = pictureBox6.Image = (Bitmap)Image.FromFile(@"customization\logo.png"); showLicense = false; } catch (Exception) { }
|
try { pictureBox1.Image = (Bitmap)Image.FromFile(Path.Combine(selfExe.Directory.FullName, @"customization\topbanner.png")); showLicense = false; } catch (Exception) { }
|
||||||
try { pictureBox3.Image = pictureBox4.Image = pictureBox5.Image = pictureBox7.Image = (Bitmap)Image.FromFile(@"customization\bottombanner.png"); showLicense = false; } catch (Exception) { }
|
try { pictureBox2.Image = pictureBox6.Image = (Bitmap)Image.FromFile(Path.Combine(selfExe.Directory.FullName, @"customization\logo.png")); showLicense = false; } catch (Exception) { }
|
||||||
|
try { pictureBox3.Image = pictureBox4.Image = pictureBox5.Image = pictureBox7.Image = (Bitmap)Image.FromFile(Path.Combine(selfExe.Directory.FullName, @"customization\bottombanner.png")); showLicense = false; } catch (Exception) { }
|
||||||
licenseLinkLabel.Visible = showLicense;
|
licenseLinkLabel.Visible = showLicense;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string[] lines = File.ReadAllLines(@"customization\customize.txt");
|
string[] lines = File.ReadAllLines(Path.Combine(selfExe.Directory.FullName, @"customization\customize.txt"));
|
||||||
if (lines[0] != "") { this.Text = lines[0]; }
|
if (lines[0] != "") { this.Text = lines[0]; }
|
||||||
if (lines[1] != "") { label1.Text = lines[1]; }
|
if (lines[1] != "") { label1.Text = lines[1]; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.IO;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Reflection;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace MeshCentralRouter
|
namespace MeshCentralRouter
|
||||||
@@ -17,7 +13,8 @@ namespace MeshCentralRouter
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
// Load customizations
|
// Load customizations
|
||||||
try { helpPictureBox.Image = (Bitmap)Image.FromFile(@"customization\help.png"); } catch (Exception) { }
|
FileInfo selfExe = new FileInfo(Assembly.GetExecutingAssembly().Location);
|
||||||
|
try { helpPictureBox.Image = (Bitmap)Image.FromFile(Path.Combine(selfExe.Directory.FullName, @"customization\help.png")); } catch (Exception) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
using System.Text;
|
||||||
|
using System.Reflection;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Net.Security;
|
using System.Net.Security;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Security.Cryptography.X509Certificates;
|
using System.Security.Cryptography.X509Certificates;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace MeshCentralRouter
|
namespace MeshCentralRouter
|
||||||
{
|
{
|
||||||
@@ -29,7 +30,8 @@ namespace MeshCentralRouter
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string[] lines = File.ReadAllLines(@"customization\customize.txt");
|
FileInfo selfExe = new FileInfo(Assembly.GetExecutingAssembly().Location);
|
||||||
|
string[] lines = File.ReadAllLines(Path.Combine(selfExe.Directory.FullName, @"customization\customize.txt"));
|
||||||
if (lines[4] != "") { this.Text = lines[4]; }
|
if (lines[4] != "") { this.Text = lines[4]; }
|
||||||
if (lines[5] != "") { mainLabel.Text = lines[5]; }
|
if (lines[5] != "") { mainLabel.Text = lines[5]; }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user