Skip to content

Commit bf6d257

Browse files
authored
Merge pull request #2 from HinanoAira/dev
LinkInstaller.exe分離
2 parents 29d597c + cf78480 commit bf6d257

11 files changed

Lines changed: 226 additions & 18 deletions

File tree

Installer/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
5+
</startup>
6+
</configuration>

Installer/LinkInstaller.csproj

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{0BAB13F8-91E3-4145-A5A7-DE5C02440C3A}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>LinkInstaller</RootNamespace>
10+
<AssemblyName>LinkInstaller</AssemblyName>
11+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<DebugType>none</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<PropertyGroup />
36+
<PropertyGroup>
37+
<StartupObject />
38+
</PropertyGroup>
39+
<PropertyGroup>
40+
<ApplicationManifest>app.manifest</ApplicationManifest>
41+
</PropertyGroup>
42+
<ItemGroup>
43+
<Reference Include="System" />
44+
<Reference Include="System.Core" />
45+
<Reference Include="System.Xml.Linq" />
46+
<Reference Include="System.Data.DataSetExtensions" />
47+
<Reference Include="Microsoft.CSharp" />
48+
<Reference Include="System.Data" />
49+
<Reference Include="System.Net.Http" />
50+
<Reference Include="System.Xml" />
51+
</ItemGroup>
52+
<ItemGroup>
53+
<Compile Include="Program.cs" />
54+
<Compile Include="Properties\AssemblyInfo.cs" />
55+
</ItemGroup>
56+
<ItemGroup>
57+
<None Include="App.config" />
58+
<None Include="app.manifest" />
59+
</ItemGroup>
60+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
61+
</Project>

Installer/Program.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using Microsoft.Win32;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.IO;
5+
using System.Linq;
6+
using System.Reflection;
7+
using System.Text;
8+
using System.Threading.Tasks;
9+
10+
namespace LinkInstaller
11+
{
12+
class Program
13+
{
14+
static void Main(string[] args)
15+
{
16+
RegistryKey rkey = Registry.ClassesRoot.OpenSubKey(@"VRChat\shell\open\command", true);
17+
if (rkey != null)
18+
{
19+
Assembly myAssembly = Assembly.GetEntryAssembly();
20+
string path = myAssembly.Location;
21+
path = Path.GetDirectoryName(path) + @"\VRChatModeSwitcher.exe";
22+
rkey.SetValue("", "\"" + path + @""" ""%1"" %*");
23+
}
24+
}
25+
}
26+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
6+
// 制御されます。アセンブリに関連付けられている情報を変更するには、
7+
// これらの属性値を変更します。
8+
[assembly: AssemblyTitle("Installer")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("Installer")]
13+
[assembly: AssemblyCopyright("Copyright © 2021")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// ComVisible を false に設定すると、このアセンブリ内の型は COM コンポーネントから
18+
// 参照できなくなります。COM からこのアセンブリ内の型にアクセスする必要がある場合は、
19+
// その型の ComVisible 属性を true に設定します。
20+
[assembly: ComVisible(false)]
21+
22+
// このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります
23+
[assembly: Guid("0bab13f8-91e3-4145-a5a7-de5c02440c3a")]
24+
25+
// アセンブリのバージョン情報は次の 4 つの値で構成されています:
26+
//
27+
// メジャー バージョン
28+
// マイナー バージョン
29+
// ビルド番号
30+
// リビジョン
31+
//
32+
// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
33+
// 既定値にすることができます:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

Installer/app.manifest

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
3+
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
4+
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
5+
<security>
6+
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
7+
<!-- UAC マニフェスト オプション
8+
Windows のユーザー アカウント制御のレベルを変更するには、
9+
requestedExecutionLevel ノードを以下のいずれかで置換します。
10+
11+
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
12+
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
13+
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
14+
15+
requestedExecutionLevel 要素を指定すると、ファイルおよびレジストリの仮想化が無効にされます。
16+
アプリケーションが下位互換性を保つためにこの仮想化を要求する場合、この要素を
17+
削除します。
18+
-->
19+
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
20+
</requestedPrivileges>
21+
</security>
22+
</trustInfo>
23+
24+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
25+
<application>
26+
<!-- このアプリケーションがテストされ、動作するよう設計された Windows バージョンの
27+
一覧。適切な要素をコメント解除すると、最も互換性のある環境を Windows が
28+
自動的に選択します。-->
29+
30+
<!-- Windows Vista -->
31+
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
32+
33+
<!-- Windows 7 -->
34+
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
35+
36+
<!-- Windows 8 -->
37+
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
38+
39+
<!-- Windows 8.1 -->
40+
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
41+
42+
<!-- Windows 10 -->
43+
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
44+
45+
</application>
46+
</compatibility>
47+
48+
<!-- アプリケーションが DPI 対応であり、それ以上の DPI で Windows によって自動的にスケーリングされないことを
49+
示します。Windows Presentation Foundation (WPF) アプリケーションは自動的に DPI に対応し、オプトインする必要は
50+
ありません。さらに、この設定にオプトインする .NET Framework 4.6 を対象とする Windows Forms アプリケーションは、
51+
app.config ファイルで 'EnableWindowsFormsHighDpiAutoResizing' 設定を 'true' に設定する必要があります。-->
52+
<!--
53+
<application xmlns="urn:schemas-microsoft-com:asm.v3">
54+
<windowsSettings>
55+
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
56+
</windowsSettings>
57+
</application>
58+
-->
59+
60+
<!-- Windows のコモン コントロールとダイアログのテーマを有効にします (Windows XP 以降) -->
61+
<!--
62+
<dependency>
63+
<dependentAssembly>
64+
<assemblyIdentity
65+
type="win32"
66+
name="Microsoft.Windows.Common-Controls"
67+
version="6.0.0.0"
68+
processorArchitecture="*"
69+
publicKeyToken="6595b64144ccf1df"
70+
language="*"
71+
/>
72+
</dependentAssembly>
73+
</dependency>
74+
-->
75+
76+
</assembly>

VRChatModeSwitcher.sln

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VRChatModeSwitcher", "VRCha
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArgDisp", "ArgDisp\ArgDisp.csproj", "{6C8B2077-391F-4508-95CD-793B5D2E3AF6}"
99
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinkInstaller", "Installer\LinkInstaller.csproj", "{0BAB13F8-91E3-4145-A5A7-DE5C02440C3A}"
11+
EndProject
1012
Global
1113
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1214
Debug|Any CPU = Debug|Any CPU
@@ -31,6 +33,14 @@ Global
3133
{6C8B2077-391F-4508-95CD-793B5D2E3AF6}.Release|Any CPU.Build.0 = Release|Any CPU
3234
{6C8B2077-391F-4508-95CD-793B5D2E3AF6}.Release|x64.ActiveCfg = Release|Any CPU
3335
{6C8B2077-391F-4508-95CD-793B5D2E3AF6}.Release|x64.Build.0 = Release|Any CPU
36+
{0BAB13F8-91E3-4145-A5A7-DE5C02440C3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37+
{0BAB13F8-91E3-4145-A5A7-DE5C02440C3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
38+
{0BAB13F8-91E3-4145-A5A7-DE5C02440C3A}.Debug|x64.ActiveCfg = Debug|Any CPU
39+
{0BAB13F8-91E3-4145-A5A7-DE5C02440C3A}.Debug|x64.Build.0 = Debug|Any CPU
40+
{0BAB13F8-91E3-4145-A5A7-DE5C02440C3A}.Release|Any CPU.ActiveCfg = Release|Any CPU
41+
{0BAB13F8-91E3-4145-A5A7-DE5C02440C3A}.Release|Any CPU.Build.0 = Release|Any CPU
42+
{0BAB13F8-91E3-4145-A5A7-DE5C02440C3A}.Release|x64.ActiveCfg = Release|Any CPU
43+
{0BAB13F8-91E3-4145-A5A7-DE5C02440C3A}.Release|x64.Build.0 = Release|Any CPU
3444
EndGlobalSection
3545
GlobalSection(SolutionProperties) = preSolution
3646
HideSolutionNode = FALSE

VRChatModeSwitcher/App.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
<add key="steamPath" value=""/>
88
<add key="oculusPath" value=""/>
99
<add key="selected" value="0"/>
10+
<add key="ShutdownDelaySecs" value="3" />
1011
</appSettings>
1112
</configuration>

VRChatModeSwitcher/Form2.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private void button3_Click(object sender, EventArgs e)
6868

6969
private void button1_Click(object sender, EventArgs e)
7070
{
71-
RegistryKey rkey = Registry.ClassesRoot.OpenSubKey(@"VRChat\shell\open\command", true);
71+
RegistryKey rkey = Registry.ClassesRoot.OpenSubKey(@"VRChat\shell\open\command");
7272
if (rkey != null)
7373
{
7474
DialogResult result = MessageBox.Show("起動リンクに紐づけしますか?",
@@ -78,9 +78,8 @@ private void button1_Click(object sender, EventArgs e)
7878
MessageBoxDefaultButton.Button2);
7979
if (result == DialogResult.Yes)
8080
{
81-
Assembly myAssembly = Assembly.GetEntryAssembly();
82-
string path = myAssembly.Location;
83-
rkey.SetValue("", "\"" + path + @""" ""%1"" %*");
81+
ProcessStartInfo psi = new ProcessStartInfo("LinkInstaller.exe");
82+
Process.Start(psi);
8483
}
8584
}
8685
else

VRChatModeSwitcher/Interface1.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

VRChatModeSwitcher/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("")]
1212
[assembly: AssemblyProduct("VRChatModeSwitcher")]
13-
[assembly: AssemblyCopyright("Copyright © 2019")]
13+
[assembly: AssemblyCopyright("雛野 綾桜 hinasense.jp © 2021")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

0 commit comments

Comments
 (0)