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