diff --git a/README.md b/README.md index 671358e..549bd13 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,8 @@

- Taskbar groups is a lightweight utility for Windows that lets the users create groups of shortcuts in the taskbar. + Taskbar groups is a lightweight utility for Windows that lets the users create groups of shortcuts in the taskbar.
+ Fully compatible with Windows 10 and Windows 11.

Download & Release Notes diff --git a/main/Classes/Category.cs b/main/Classes/Category.cs index 4dc92b9..f955a6d 100644 --- a/main/Classes/Category.cs +++ b/main/Classes/Category.cs @@ -62,12 +62,12 @@ public Category(string path) public void CreateConfig(Image groupImage) { - string path = @"config\" + this.Name; + string path = Path.Combine(MainPath.path, "config", this.Name); //string filePath = path + @"\" + this.Name + "Group.exe"; // // Directory and .exe // - System.IO.Directory.CreateDirectory(@path); + System.IO.Directory.CreateDirectory(path); //System.IO.File.Copy(@"config\config.exe", @filePath); // @@ -76,7 +76,7 @@ public void CreateConfig(Image groupImage) System.Xml.Serialization.XmlSerializer writer = new System.Xml.Serialization.XmlSerializer(typeof(Category)); - using (FileStream file = System.IO.File.Create(@path + @"\ObjectData.xml")) + using (FileStream file = System.IO.File.Create(Path.Combine(path, "ObjectData.xml"))) { writer.Serialize(file, this); file.Close(); @@ -86,14 +86,16 @@ public void CreateConfig(Image groupImage) // Image img = ImageFunctions.ResizeImage(groupImage, 256, 256); // Resize img if too big - img.Save(path + @"\GroupImage.png"); + img.Save(Path.Combine(path, "GroupImage.png")); + + string iconPath = Path.Combine(path, "GroupIcon.ico"); if (GetMimeType(groupImage).ToString() == "*.PNG") { - createMultiIcon(groupImage, path + @"\GroupIcon.ico"); + createMultiIcon(groupImage, iconPath); } else { - using (FileStream fs = new FileStream(path + @"\GroupIcon.ico", FileMode.Create)) + using (FileStream fs = new FileStream(iconPath, FileMode.Create)) { ImageFunctions.IconFromImage(img).Save(fs); fs.Close(); @@ -105,12 +107,12 @@ public void CreateConfig(Image groupImage) // Needed due to needing to set a unique AppUserModelID so the shortcut applications don't stack on the taskbar with the main application // Tricks Windows to think they are from different applications even though they are from the same .exe ShellLink.InstallShortcut( - Path.GetFullPath(@System.AppDomain.CurrentDomain.FriendlyName), + MainPath.exeString, "tjackenpacken.taskbarGroup.menu." + this.Name, - path + " shortcut", - Path.GetFullPath(@path), - Path.GetFullPath(path + @"\GroupIcon.ico"), - path + "\\" + this.Name + ".lnk", + this.Name + " shortcut", + path, + iconPath, + Path.Combine(path, this.Name + ".lnk"), this.Name ); @@ -118,8 +120,8 @@ public void CreateConfig(Image groupImage) // Build the icon cache cacheIcons(); - System.IO.File.Move(@path + "\\" + this.Name + ".lnk", - Path.GetFullPath(@"Shortcuts\" + Regex.Replace(this.Name, @"(_)+", " ") + ".lnk")); // Move .lnk to correct directory + System.IO.File.Move(Path.Combine(path, this.Name + ".lnk"), + Path.Combine(MainPath.path, "Shortcuts", Regex.Replace(this.Name, @"(_)+", " ") + ".lnk")); // Move .lnk to correct directory } private static void createMultiIcon(Image iconImage, string filePath) diff --git a/main/Properties/app.manifest b/main/Properties/app.manifest new file mode 100644 index 0000000..458b6ee --- /dev/null +++ b/main/Properties/app.manifest @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main/client.csproj b/main/client.csproj index 137d4c9..53df392 100644 --- a/main/client.csproj +++ b/main/client.csproj @@ -52,6 +52,7 @@ Icon.ico + Properties\app.manifest