Skip to content

Commit

Permalink
Infrastructure Preparation 300
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Oct 23, 2024
1 parent 4cf63d4 commit 15448aa
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Skylark" Version="3.1.4.8" />
<PackageReference Include="Skylark.Wing" Version="3.1.6.7" />
<PackageReference Include="Skylark.Wing" Version="3.1.6.8" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Skylark.Clipboard/Skylark.Clipboard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub">
<Version>9.0.0-beta.24508.2</Version>
<Version>9.0.0-beta.24522.2</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Skylark.DNS/Skylark.DNS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub">
<Version>9.0.0-beta.24508.2</Version>
<Version>9.0.0-beta.24522.2</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Skylark.Standard/Skylark.Standard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub">
<Version>9.0.0-beta.24508.2</Version>
<Version>9.0.0-beta.24522.2</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Skylark.Uptime/Skylark.Uptime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// Creator: Taiizor
// Website: www.vegalya.com
// Created: 27.Feb.2023
// Changed: 10.Oct.2024
// Changed: 23.Oct.2024
// Version: 3.1.5.4
//
// |---------DO-NOT-REMOVE---------|
Expand Down
2 changes: 1 addition & 1 deletion src/Skylark.Uptime/Skylark.Uptime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub">
<Version>9.0.0-beta.24508.2</Version>
<Version>9.0.0-beta.24522.2</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
19 changes: 10 additions & 9 deletions src/Skylark.Wing/Helper/ShortcutBasic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,33 @@ public static void Create(string linkFileName, string targetPath, string working
string iconLocation = string.Format("{0},{1}", targetPath, iconNumber);

#if NET6_0_OR_GREATER
Type shellType = SWMI.M_TYPE;
dynamic shell = SWMI.M_SHELL;
dynamic shortcut = shell.CreateShortcut(linkFileName);

shortcut.TargetPath = targetPath;
shortcut.WorkingDirectory = workingDirectory;
shortcut.Arguments = arguments;
shortcut.Hotkey = hotkey;
shortcut.WindowStyle = shortcutWindowStyle;
shortcut.Arguments = arguments;
shortcut.TargetPath = targetPath;
shortcut.Description = description;
shortcut.IconLocation = iconLocation;
shortcut.WindowStyle = shortcutWindowStyle;
shortcut.WorkingDirectory = workingDirectory;

shortcut.Save();
#else
Type shellType = SWMI.M_TYPE;

object shell = SWMI.M_SHELL;
object shortcut = shellType.InvokeMethod("CreateShortcut", shell, linkFileName);

Type shortcutType = shortcut.GetType();

shortcutType.InvokeSetMember("TargetPath", shortcut, targetPath);
shortcutType.InvokeSetMember("WorkingDirectory", shortcut, workingDirectory);
shortcutType.InvokeSetMember("Arguments", shortcut, arguments);
shortcutType.InvokeSetMember("Hotkey", shortcut, hotkey);
shortcutType.InvokeSetMember("WindowStyle", shortcut, shortcutWindowStyle);
shortcutType.InvokeSetMember("Arguments", shortcut, arguments);
shortcutType.InvokeSetMember("TargetPath", shortcut, targetPath);
shortcutType.InvokeSetMember("Description", shortcut, description);
shortcutType.InvokeSetMember("IconLocation", shortcut, iconLocation);
shortcutType.InvokeSetMember("WindowStyle", shortcut, shortcutWindowStyle);
shortcutType.InvokeSetMember("WorkingDirectory", shortcut, workingDirectory);

shortcutType.InvokeMethod("Save", shortcut);
#endif
Expand Down
14 changes: 8 additions & 6 deletions src/Skylark.Wing/Helper/ShortcutRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,35 @@ public static class ShortcutRuntime
public static void Create(string shortcutLocation, string shortcutName, string description, string hotkey, string targetPath, string iconLocation = null, string workingDirectory = null, string arguments = null, SWNM.WindowStyle windowStyle = SWNM.WindowStyle.Normal)
{
WshShell shell = new();

string shortcutAddress = Path.Combine(shortcutLocation, shortcutName);
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(shortcutAddress);

shortcut.Description = description;
shortcut.TargetPath = targetPath;

if (hotkey != null)
if (workingDirectory != null)
{
shortcut.Hotkey = hotkey;
shortcut.WorkingDirectory = workingDirectory;
}

if (iconLocation != null)
{
shortcut.IconLocation = iconLocation;
}

if (workingDirectory != null)
if (arguments != null)
{
shortcut.WorkingDirectory = workingDirectory;
shortcut.Arguments = arguments;
}

if (arguments != null)
if (hotkey != null)
{
shortcut.Arguments = arguments;
shortcut.Hotkey = hotkey;
}

shortcut.WindowStyle = (int)windowStyle;

shortcut.Save();
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Skylark.Wing/Skylark.Wing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
// Creator: Taiizor
// Website: www.vegalya.com
// Created: 17.Jun.2023
// Changed: 10.Oct.2024
// Version: 3.1.6.8
// Changed: 23.Oct.2024
// Version: 3.1.6.9
//
// |---------DO-NOT-REMOVE---------|

Expand Down
6 changes: 3 additions & 3 deletions src/Skylark.Wing/Skylark.Wing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<PropertyGroup>
<ApplicationIcon>Resources\Skylark.Wing.ico</ApplicationIcon>
<Version>3.1.6.8</Version>
<Version>3.1.6.9</Version>
<AssemblyVersion>$(Version)</AssemblyVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Title>Skylark.Wing</Title>
Expand Down Expand Up @@ -51,7 +51,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub">
<Version>9.0.0-beta.24508.2</Version>
<Version>9.0.0-beta.24522.2</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand All @@ -77,7 +77,7 @@
<PackageReference Condition="$(TargetFramework.StartsWith('net6'))" Include="System.Management" Version="6.0.2" />
<PackageReference Condition="$(TargetFramework.StartsWith('net7'))" Include="System.Management" Version="7.0.2" />
<PackageReference Condition="$(TargetFramework.StartsWith('net8'))" Include="System.Management" Version="8.0.0" />
<PackageReference Condition="$(TargetFramework.StartsWith('net9'))" Include="System.Management" Version="9.0.0-rtm.24509.7" />
<PackageReference Condition="$(TargetFramework.StartsWith('net9'))" Include="System.Management" Version="9.0.0-rtm.24516.5" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Skylark/Skylark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// Creator: Taiizor
// Website: www.vegalya.com
// Created: 03.Jan.2023
// Changed: 10.Oct.2024
// Changed: 23.Oct.2024
// Version: 3.1.4.9
//
// |---------DO-NOT-REMOVE---------|
Expand Down
2 changes: 1 addition & 1 deletion src/Skylark/Skylark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub">
<Version>9.0.0-beta.24508.2</Version>
<Version>9.0.0-beta.24522.2</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down

0 comments on commit 15448aa

Please sign in to comment.