-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
257 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> | ||
</startup> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{ADDF68C2-D65A-4830-A2C3-CCBD85536266}</ProjectGuid> | ||
<OutputType>Exe</OutputType> | ||
<RootNamespace>Installer</RootNamespace> | ||
<AssemblyName>Installer</AssemblyName> | ||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> | ||
<Deterministic>true</Deterministic> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>..\bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<ApplicationManifest>app.manifest</ApplicationManifest> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Program.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="App.config" /> | ||
<None Include="app.manifest" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
using System; | ||
using System.IO; | ||
using Microsoft.Win32; | ||
|
||
namespace Installer | ||
{ | ||
|
||
/// <summary> | ||
/// Entry point for the installer. | ||
/// </summary> | ||
class Program | ||
{ | ||
|
||
const string URI_SCHEME = "mukwty-wpf"; | ||
const string URI_KEY = "URL:mukwty Protocol"; | ||
|
||
static void RegisterUriScheme(string appPath) | ||
{ | ||
// HKEY_CLASSES_ROOT\es-one-desktop-test | ||
using (var hkcrClass = Registry.ClassesRoot.CreateSubKey(URI_SCHEME)) | ||
{ | ||
hkcrClass.SetValue(null, URI_KEY); | ||
hkcrClass.SetValue("URL Protocol", string.Empty, RegistryValueKind.String); | ||
|
||
// use the application's icon as the URI scheme icon | ||
using (var defaultIcon = hkcrClass.CreateSubKey("DefaultIcon")) | ||
{ | ||
var iconValue = string.Format("\"{0}\",0", appPath); | ||
defaultIcon.SetValue(null, iconValue); | ||
} | ||
|
||
// open the application and pass the URI to the command-line | ||
using (var shell = hkcrClass.CreateSubKey("shell")) | ||
{ | ||
using (var open = shell.CreateSubKey("open")) | ||
{ | ||
using (var command = open.CreateSubKey("command")) | ||
{ | ||
var cmdValue = string.Format("\"{0}\" \"%1\"", appPath); | ||
command.SetValue(null, cmdValue); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
static void UnregisterUriScheme() | ||
{ | ||
Registry.ClassesRoot.DeleteSubKeyTree(URI_SCHEME); | ||
} | ||
|
||
static void Main(string[] args) | ||
{ | ||
if ((args.Length > 0) && (args[0].Equals("/u") || args[0].Equals("-u"))) | ||
{ | ||
// uninstall | ||
Console.Write("Attempting to unregister URI scheme..."); | ||
|
||
try | ||
{ | ||
UnregisterUriScheme(); | ||
Console.WriteLine(" Success."); | ||
} | ||
catch (Exception ex) | ||
{ | ||
Console.WriteLine(" Failed!"); | ||
Console.WriteLine("{0}: {1}", ex.GetType().Name, ex.Message); | ||
} | ||
} | ||
else | ||
{ | ||
// install | ||
var appPath = Path.Combine(Path.GetDirectoryName(typeof(Program).Assembly.Location), "MultiProcessWPF.exe"); | ||
|
||
Console.Write("Attempting to register URI scheme..."); | ||
|
||
try | ||
{ | ||
if (!File.Exists(appPath)) | ||
{ | ||
throw new InvalidOperationException(string.Format("Application not found at: {0}", appPath)); | ||
} | ||
|
||
RegisterUriScheme(appPath); | ||
Console.WriteLine(" Success."); | ||
} | ||
catch (Exception ex) | ||
{ | ||
Console.WriteLine(" Failed!"); | ||
Console.WriteLine("{0}: {1}", ex.GetType().Name, ex.Message); | ||
} | ||
} | ||
|
||
Console.WriteLine(); | ||
Console.WriteLine("Press any key to continue..."); | ||
Console.ReadKey(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("Installer")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("Installer")] | ||
[assembly: AssemblyCopyright("Copyright © 2024")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("addf68c2-d65a-4830-a2c3-ccbd85536266")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/> | ||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> | ||
<security> | ||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> | ||
<!-- UAC Manifest Options | ||
If you want to change the Windows User Account Control level replace the | ||
requestedExecutionLevel node with one of the following. | ||
<requestedExecutionLevel level="asInvoker" uiAccess="false" /> | ||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> | ||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" /> | ||
Specifying requestedExecutionLevel node will disable file and registry virtualization. | ||
If you want to utilize File and Registry Virtualization for backward | ||
compatibility then delete the requestedExecutionLevel node. | ||
--> | ||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> | ||
</requestedPrivileges> | ||
</security> | ||
</trustInfo> | ||
|
||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> | ||
<application> | ||
<!-- A list of all Windows versions that this application is designed to work with. | ||
Windows will automatically select the most compatible environment.--> | ||
|
||
<!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node--> | ||
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>--> | ||
|
||
<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node--> | ||
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>--> | ||
|
||
<!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node--> | ||
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>--> | ||
|
||
</application> | ||
</compatibility> | ||
|
||
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) --> | ||
<!-- <dependency> | ||
<dependentAssembly> | ||
<assemblyIdentity | ||
type="win32" | ||
name="Microsoft.Windows.Common-Controls" | ||
version="6.0.0.0" | ||
processorArchitecture="*" | ||
publicKeyToken="6595b64144ccf1df" | ||
language="*" | ||
/> | ||
</dependentAssembly> | ||
</dependency>--> | ||
|
||
</asmv1:assembly> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters