Skip to content

Commit

Permalink
No longer have to delete iCuePath to fix it, quoted paths that needed…
Browse files Browse the repository at this point in the history
… it.
  • Loading branch information
Epicminer256 committed Jun 24, 2024
1 parent 363af19 commit e375c9b
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ public MainMenuForm()
if(File.Exists(iCue_Path_ConfigPath)){
iCue_Path = File.ReadAllText(iCue_Path_ConfigPath);
if(!File.Exists(System.IO.Path.Combine(iCue_Path,"iCUE.exe"))){
MessageBox.Show("The file \"iCuePath\" in your config points to a invalid path. Delete that file and start this program again to fix it.");
this.Close();
Application.Exit();
System.Environment.Exit(1);
iCue_Path = "";
}
} else {
}
if(iCue_Path == ""){
if(File.Exists("C:\\Program Files\\Corsair\\Corsair iCUE5 Software\\iCUE.exe")){
iCue_Path = "C:\\Program Files\\Corsair\\CORSAIR iCUE5 Software\\";
}
Expand Down Expand Up @@ -69,7 +67,6 @@ public MainMenuForm()
}
File.WriteAllText(iCue_Path_ConfigPath, iCue_Path);
}

string Backup_Sys_Path = System.IO.Path.Combine(iCue_Path, "sounds\\backup");
string Current_Sound_Path = System.IO.Path.Combine(iCue_Path, "sounds\\default");

Expand Down Expand Up @@ -200,7 +197,7 @@ public MainMenuForm()
void Restart_iCue_Click(object sender, EventArgs e){
System.Diagnostics.Process.Start("C:\\Windows\\System32\\taskkill.exe"," /F /IM iCUE.exe");
Thread.Sleep(2000);
System.Diagnostics.Process.Start(System.IO.Path.Combine(iCue_Path,"iCUE.exe"));
System.Diagnostics.Process.Start("\""+System.IO.Path.Combine(iCue_Path,"iCUE.exe")+"\"");
}
Restart_iCue.Click += Restart_iCue_Click;

Expand Down Expand Up @@ -251,7 +248,7 @@ void RestoreFactory_Click(object sender, EventArgs e) {
foreach(var file in allBackupFiles){
File.Copy(file, System.IO.Path.Combine( Current_Sound_Path,Path.GetFileName(file)), true);
}
System.Diagnostics.Process.Start(System.IO.Path.Combine(iCue_Path,"iCUE.exe"));
System.Diagnostics.Process.Start("\""+System.IO.Path.Combine(iCue_Path,"iCUE.exe")+"\"");
MessageBox.Show("Done!");
}
RestoreFactory.Click += RestoreFactory_Click;
Expand Down Expand Up @@ -343,7 +340,7 @@ void OnSelect(object sender, EventArgs e){
File.Copy(file, outputFilePath, true);

}
System.Diagnostics.Process.Start(System.IO.Path.Combine(iCue_Path,"iCUE.exe"));
System.Diagnostics.Process.Start("\""+System.IO.Path.Combine(iCue_Path,"iCUE.exe")+"\"");
MessageBox.Show("Now Using: "+selectedItem);
}

Expand Down

0 comments on commit e375c9b

Please sign in to comment.