Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
BearOffice committed Oct 26, 2021
0 parents commit 4feee02
Show file tree
Hide file tree
Showing 18 changed files with 329 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
25 changes: 25 additions & 0 deletions OpenChrome.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30503.244
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenChrome", "OpenChrome\OpenChrome.csproj", "{B0E33193-3214-449C-8CDB-F4275D7CECB3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B0E33193-3214-449C-8CDB-F4275D7CECB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B0E33193-3214-449C-8CDB-F4275D7CECB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B0E33193-3214-449C-8CDB-F4275D7CECB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B0E33193-3214-449C-8CDB-F4275D7CECB3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FF4485A9-EA7A-4641-BD68-9E2558399922}
EndGlobalSection
EndGlobal
Binary file added OpenChrome/Chrome.ico
Binary file not shown.
Binary file added OpenChrome/ConfReaderLib.dll
Binary file not shown.
94 changes: 94 additions & 0 deletions OpenChrome/ConfReaderLib.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions OpenChrome/OpenChrome.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<ApplicationIcon>Chrome.ico</ApplicationIcon>
<NoWin32Manifest>true</NoWin32Manifest>
</PropertyGroup>

<ItemGroup>
<Reference Include="ConfReaderLib">
<HintPath>ConfReaderLib.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
<None Update="Path.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions OpenChrome/Path.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
program path = C:\Program Files\Google\Chrome\Application\chrome.exe // Chrome's path
instance path = E:\Chrome Instance // Instance path
13 changes: 13 additions & 0 deletions OpenChrome/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Diagnostics;
using ConfReaderLib;

// Chrome Icon Artist: firstfear(firstfear.deviantart.com)

try
{
var conf = new ConfReader(new[] { "program path", "instance path" }, "Path.txt");
var programpath = conf.GetConf("program path");
var instancepath = conf.GetConf("instance path");
Process.Start(programpath, $"--user-data-dir=\"{instancepath}\"");
}
catch { }
17 changes: 17 additions & 0 deletions OpenChrome/Properties/PublishProfiles/FolderProfile.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net5.0\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net5.0</TargetFramework>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
<PublishReadyToRun>True</PublishReadyToRun>
</PropertyGroup>
</Project>
Binary file added OpenChrome/bin/Debug/net5.0/ConfReaderLib.dll
Binary file not shown.
94 changes: 94 additions & 0 deletions OpenChrome/bin/Debug/net5.0/ConfReaderLib.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions OpenChrome/bin/Debug/net5.0/OpenChrome.deps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v5.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v5.0": {
"OpenChrome/1.0.0": {
"dependencies": {
"ConfReaderLib": "1.0.0.0"
},
"runtime": {
"OpenChrome.dll": {}
}
},
"ConfReaderLib/1.0.0.0": {
"runtime": {
"ConfReaderLib.dll": {
"assemblyVersion": "1.0.0.0",
"fileVersion": "1.0.0.0"
}
}
}
}
},
"libraries": {
"OpenChrome/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"ConfReaderLib/1.0.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
}
}
}
Binary file added OpenChrome/bin/Debug/net5.0/OpenChrome.dll
Binary file not shown.
Binary file added OpenChrome/bin/Debug/net5.0/OpenChrome.exe
Binary file not shown.
9 changes: 9 additions & 0 deletions OpenChrome/bin/Debug/net5.0/OpenChrome.runtimeconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"runtimeOptions": {
"tfm": "net5.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "5.0.0"
}
}
}
2 changes: 2 additions & 0 deletions OpenChrome/bin/Debug/net5.0/Path.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
program path = C:\Program Files\Google\Chrome\Application\chrome.exe // Chrome's path
instance path = E:\Chrome Instance // Instance path
Binary file added OpenChrome/bin/Debug/net5.0/ref/OpenChrome.dll
Binary file not shown.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# OpenChrome
Create and open a chrome instance.

Usually, create a chrome shortcut manually with args --user-data-dir="{instancepath}" to create or open a chrome instance will work out well.
But this method won't work if the shortcut pinned to taskbar or Start.

Using library [ConfReaderLib](https://github.com/MisakiBear/ConfReaderLib)

# How to use
Modify the "Path.txt" file to use.

0 comments on commit 4feee02

Please sign in to comment.