Skip to content

Commit 24f5ec8

Browse files
authored
fix: Update file location for #2683 (#2688)
1 parent 0de510f commit 24f5ec8

File tree

3 files changed

+69
-73
lines changed

3 files changed

+69
-73
lines changed

sources/tools/Stride.VisualStudio.Package/Stride.VisualStudio.Package.csproj

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@
5353
</Compile>
5454
<Compile Include="..\..\core\Stride.Core.Design\Extensions\ExceptionExtensions.cs" Link="Assets\ExceptionExtensions.cs" />
5555
<Compile Include="..\..\core\Stride.Core.Design\PackageVersion.cs" Link="Core\PackageVersion.cs" />
56-
<Compile Include="..\..\core\Stride.Core.Design\VisualStudio\KeyedCollectionExtensions.cs" Link="Core\VisualStudio\KeyedCollectionExtensions.cs" />
57-
<Compile Include="..\..\core\Stride.Core.Design\VisualStudio\KnownProjectTypeGuid.cs" Link="Core\VisualStudio\KnownProjectTypeGuid.cs" />
58-
<Compile Include="..\..\core\Stride.Core.Design\VisualStudio\Project.cs" Link="Core\VisualStudio\Project.cs" />
59-
<Compile Include="..\..\core\Stride.Core.Design\VisualStudio\ProjectCollection.cs" Link="Core\VisualStudio\ProjectCollection.cs" />
60-
<Compile Include="..\..\core\Stride.Core.Design\VisualStudio\PropertyItem.cs" Link="Core\VisualStudio\PropertyItem.cs" />
61-
<Compile Include="..\..\core\Stride.Core.Design\VisualStudio\PropertyItemCollection.cs" Link="Core\VisualStudio\PropertyItemCollection.cs" />
62-
<Compile Include="..\..\core\Stride.Core.Design\VisualStudio\Section.cs" Link="Core\VisualStudio\Section.cs" />
63-
<Compile Include="..\..\core\Stride.Core.Design\VisualStudio\SectionCollection.cs" Link="Core\VisualStudio\SectionCollection.cs" />
64-
<Compile Include="..\..\core\Stride.Core.Design\VisualStudio\Solution.cs" Link="Core\VisualStudio\Solution.cs" />
65-
<Compile Include="..\..\core\Stride.Core.Design\VisualStudio\SolutionFileException.cs" Link="Core\VisualStudio\SolutionFileException.cs" />
66-
<Compile Include="..\..\core\Stride.Core.Design\VisualStudio\SolutionReader.cs" Link="Core\VisualStudio\SolutionReader.cs" />
67-
<Compile Include="..\..\core\Stride.Core.Design\VisualStudio\SolutionWriter.cs" Link="Core\VisualStudio\SolutionWriter.cs" />
56+
<Compile Include="..\..\core\Stride.Core.Design\Solutions\KeyedCollectionExtensions.cs" Link="Core\Solutions\KeyedCollectionExtensions.cs" />
57+
<Compile Include="..\..\core\Stride.Core.Design\Solutions\KnownProjectTypeGuid.cs" Link="Core\Solutions\KnownProjectTypeGuid.cs" />
58+
<Compile Include="..\..\core\Stride.Core.Design\Solutions\Project.cs" Link="Core\Solutions\Project.cs" />
59+
<Compile Include="..\..\core\Stride.Core.Design\Solutions\ProjectCollection.cs" Link="Core\Solutions\ProjectCollection.cs" />
60+
<Compile Include="..\..\core\Stride.Core.Design\Solutions\PropertyItem.cs" Link="Core\Solutions\PropertyItem.cs" />
61+
<Compile Include="..\..\core\Stride.Core.Design\Solutions\PropertyItemCollection.cs" Link="Core\Solutions\PropertyItemCollection.cs" />
62+
<Compile Include="..\..\core\Stride.Core.Design\Solutions\Section.cs" Link="Core\Solutions\Section.cs" />
63+
<Compile Include="..\..\core\Stride.Core.Design\Solutions\SectionCollection.cs" Link="Core\Solutions\SectionCollection.cs" />
64+
<Compile Include="..\..\core\Stride.Core.Design\Solutions\Solution.cs" Link="Core\Solutions\Solution.cs" />
65+
<Compile Include="..\..\core\Stride.Core.Design\Solutions\SolutionFileException.cs" Link="Core\Solutions\SolutionFileException.cs" />
66+
<Compile Include="..\..\core\Stride.Core.Design\Solutions\SolutionReader.cs" Link="Core\Solutions\SolutionReader.cs" />
67+
<Compile Include="..\..\core\Stride.Core.Design\Solutions\SolutionWriter.cs" Link="Core\Solutions\SolutionWriter.cs" />
6868
<Compile Include="..\..\core\Stride.Core\ScalarStyle.cs" Link="Yaml\ScalarStyle.cs" />
6969
<Compile Include="..\..\core\Stride.Core\DataStyle.cs" Link="Yaml\DataStyle.cs" />
7070
<Compile Include="..\..\core\Stride.Core.Yaml\*.cs" Link="Yaml\%(Filename)%(Extension).cs" />
Lines changed: 53 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,75 @@
11
// Copyright (c) .NET Foundation and Contributors (https://dotnetfoundation.org/ & https://stride3d.net) and Silicon Studio Corp. (https://www.siliconstudio.co.jp)
22
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.
3-
using System;
43
using System.Diagnostics;
5-
using System.IO;
6-
using System.Linq;
7-
using Stride.Core.CodeEditor.VisualStudio;
4+
using Stride.Core.CodeEditorSupport.VisualStudio;
85

9-
namespace Stride.VisualStudio.PackageInstall
6+
namespace Stride.VisualStudio.PackageInstall;
7+
8+
static class Program
109
{
11-
class Program
10+
static int Main(string[] args)
1211
{
13-
static int Main(string[] args)
12+
try
1413
{
15-
try
14+
if (args.Length == 0)
1615
{
17-
if (args.Length == 0)
18-
{
19-
throw new Exception("Expecting a parameter such as /install, /repair or /uninstall");
20-
}
16+
throw new Exception("Expecting a parameter such as /install, /repair or /uninstall");
17+
}
18+
19+
const string vsixFile = "Stride.vsix";
2120

22-
const string vsixFile = "Stride.vsix";
21+
// Locate a VS installation with VSIXInstaller.exe.
22+
// Select the latest version of VS possible, in case there is some bugfixes or incompatible changes.
23+
var visualStudioVersionByVsixVersion = VisualStudioVersions.AvailableInstances.Where(x => x.HasVsixInstaller);
24+
var ideInfo = visualStudioVersionByVsixVersion.OrderByDescending(x => x.InstallationVersion).FirstOrDefault(x => File.Exists(x.VsixInstallerPath));
25+
if (ideInfo == null)
26+
{
27+
throw new InvalidOperationException($"Could not find a proper installation of Visual Studio 2019 or later");
28+
}
2329

24-
// Locate a VS installation with VSIXInstaller.exe.
25-
// Select the latest version of VS possible, in case there is some bugfixes or incompatible changes.
26-
var visualStudioVersionByVsixVersion = VisualStudioVersions.AvailableInstances.Where(x => x.HasVsixInstaller);
27-
var ideInfo = visualStudioVersionByVsixVersion.OrderByDescending(x => x.InstallationVersion).FirstOrDefault(x => File.Exists(x.VsixInstallerPath));
28-
if (ideInfo == null)
30+
switch (args[0])
31+
{
32+
case "/install":
33+
case "/repair":
2934
{
30-
throw new InvalidOperationException($"Could not find a proper installation of Visual Studio 2019 or later");
35+
// Install VSIX
36+
var exitCode = RunVsixInstaller(ideInfo.VsixInstallerPath, "\"" + vsixFile + "\"");
37+
if (exitCode != 0)
38+
throw new InvalidOperationException($"VSIX Installer didn't run properly: exit code {exitCode}");
39+
break;
3140
}
3241

33-
switch (args[0])
42+
case "/uninstall":
3443
{
35-
case "/install":
36-
case "/repair":
37-
{
38-
// Install VSIX
39-
var exitCode = RunVsixInstaller(ideInfo.VsixInstallerPath, "\"" + vsixFile + "\"");
40-
if (exitCode != 0)
41-
throw new InvalidOperationException($"VSIX Installer didn't run properly: exit code {exitCode}");
42-
break;
43-
}
44-
45-
case "/uninstall":
46-
{
47-
// Note: we allow uninstall to fail (i.e. VSIX was not installed for that specific Visual Studio version)
48-
RunVsixInstaller(ideInfo.VsixInstallerPath, "/uninstall:Stride.VisualStudio.Package.2022 /quiet");
49-
break;
50-
}
44+
// Note: we allow uninstall to fail (i.e. VSIX was not installed for that specific Visual Studio version)
45+
RunVsixInstaller(ideInfo.VsixInstallerPath, "/uninstall:Stride.VisualStudio.Package.2022 /quiet");
46+
break;
5147
}
52-
53-
return 0;
54-
}
55-
catch (Exception e)
56-
{
57-
Console.WriteLine($"Error: {e}");
58-
return 1;
5948
}
49+
50+
return 0;
51+
}
52+
catch (Exception e)
53+
{
54+
Console.WriteLine($"Error: {e}");
55+
return 1;
6056
}
57+
}
6158

62-
/// <summary>
63-
/// Starts the VSIX installer at the given path with the given argument, and waits for the process to exit before returning.
64-
/// </summary>
65-
/// <param name="pathToVsixInstaller">The path to a VSIX installer provided by a version of Visual Studio.</param>
66-
/// <param name="arguments">The arguments to pass to the VSIX installer.</param>
67-
/// <returns><c>True</c> if the VSIX installer exited with code 0, <c>False</c> otherwise.</returns>
68-
private static int RunVsixInstaller(string pathToVsixInstaller, string arguments)
59+
/// <summary>
60+
/// Starts the VSIX installer at the given path with the given argument, and waits for the process to exit before returning.
61+
/// </summary>
62+
/// <param name="pathToVsixInstaller">The path to a VSIX installer provided by a version of Visual Studio.</param>
63+
/// <param name="arguments">The arguments to pass to the VSIX installer.</param>
64+
/// <returns><c>True</c> if the VSIX installer exited with code 0, <c>False</c> otherwise.</returns>
65+
private static int RunVsixInstaller(string pathToVsixInstaller, string arguments)
66+
{
67+
var process = Process.Start(pathToVsixInstaller, arguments);
68+
if (process == null)
6969
{
70-
var process = Process.Start(pathToVsixInstaller, arguments);
71-
if (process == null)
72-
{
73-
return -1;
74-
}
75-
process.WaitForExit();
76-
return process.ExitCode;
70+
return -1;
7771
}
72+
process.WaitForExit();
73+
return process.ExitCode;
7874
}
7975
}

sources/tools/Stride.VisualStudio.PackageInstall/Stride.VisualStudio.PackageInstall.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>net461</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
66
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
77
<RestorePackages>true</RestorePackages>
@@ -26,13 +26,13 @@
2626
</PackageReference>
2727
</ItemGroup>
2828
<ItemGroup>
29-
<Compile Include="..\..\core\Stride.Core.Design\CodeEditor\IDEType.cs">
29+
<Compile Include="..\..\core\Stride.Core.Design\CodeEditorSupport\IDEType.cs">
3030
<Link>IDEType.cs</Link>
3131
</Compile>
32-
<Compile Include="..\..\core\Stride.Core.Design\CodeEditor\IDEInfo.cs">
32+
<Compile Include="..\..\core\Stride.Core.Design\CodeEditorSupport\IDEInfo.cs">
3333
<Link>IDEInfo.cs</Link>
3434
</Compile>
35-
<Compile Include="..\..\core\Stride.Core.Design\CodeEditor\VisualStudio\VisualStudioVersions.cs">
35+
<Compile Include="..\..\core\Stride.Core.Design\CodeEditorSupport\VisualStudio\VisualStudioVersions.cs">
3636
<Link>VisualStudioVersions.cs</Link>
3737
</Compile>
3838
</ItemGroup>

0 commit comments

Comments
 (0)