mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-15 11:17:53 +01:00
Merge branch 'dev/feature/projects' of https://github.com/microsoft/PowerToys into dev/feature/projects
This commit is contained in:
@@ -171,19 +171,19 @@ namespace ProjectsEditor.ViewModels
|
||||
File.WriteAllBytes(shortcutAddress, Array.Empty<byte>());
|
||||
|
||||
// Create a ShellLinkObject that references the .lnk file
|
||||
Shell32.Shell shl = new Shell32.Shell();
|
||||
Shell32.Folder dir = shl.NameSpace(FolderUtils.Desktop());
|
||||
Shell32.FolderItem itm = dir.Items().Item($"{project.Name}.lnk");
|
||||
Shell32.ShellLinkObject lnk = (Shell32.ShellLinkObject)itm.GetLink;
|
||||
Shell32.Shell shell = new Shell32.Shell();
|
||||
Shell32.Folder dir = shell.NameSpace(FolderUtils.Desktop());
|
||||
Shell32.FolderItem folderItem = dir.Items().Item($"{project.Name}.lnk");
|
||||
Shell32.ShellLinkObject link = (Shell32.ShellLinkObject)folderItem.GetLink;
|
||||
|
||||
// Set the .lnk file properties
|
||||
lnk.Description = $"Project Launcher {project.Id}";
|
||||
lnk.Path = Path.Combine(basePath, "PowerToys.ProjectsLauncher.exe");
|
||||
lnk.Arguments = project.Id.ToString();
|
||||
lnk.WorkingDirectory = basePath;
|
||||
lnk.SetIconLocation(shortcutIconFilename, 0);
|
||||
link.Description = $"Project Launcher {project.Id}";
|
||||
link.Path = Path.Combine(basePath, "PowerToys.ProjectsLauncher.exe");
|
||||
link.Arguments = project.Id.ToString();
|
||||
link.WorkingDirectory = basePath;
|
||||
link.SetIconLocation(shortcutIconFilename, 0);
|
||||
|
||||
lnk.Save(shortcutAddress);
|
||||
link.Save(shortcutAddress);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user