diff --git a/Program.cs b/Program.cs index d057e6de..a3098b3b 100644 --- a/Program.cs +++ b/Program.cs @@ -133,10 +133,10 @@ private static void Main(){ AcceptLanguageList = BrowserUtils.HeaderAcceptLanguage, UserAgent = BrowserUtils.HeaderUserAgent, Locale = Arguments.GetValue(Arguments.ArgLocale, string.Empty), + BrowserSubprocessPath = BrandName+".Browser.exe", CachePath = StoragePath, LogFile = ConsoleLogFilePath, #if !DEBUG - BrowserSubprocessPath = BrandName+".Browser.exe", LogSeverity = Arguments.HasFlag(Arguments.ArgLogging) ? LogSeverity.Info : LogSeverity.Disable #endif }; diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index e385f957..eb0ded86 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -37,7 +37,7 @@ [assembly: AssemblyVersion(Program.VersionFull)] [assembly: AssemblyFileVersion(Program.VersionFull)] -[assembly: NeutralResourcesLanguageAttribute("en")] +[assembly: NeutralResourcesLanguage("en")] [assembly: CLSCompliant(false)] diff --git a/TweetDck.csproj b/TweetDck.csproj index 129e1587..fe0e9161 100644 --- a/TweetDck.csproj +++ b/TweetDck.csproj @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="packages\CefSharp.WinForms.57.0.0\build\CefSharp.WinForms.props" Condition="Exists('packages\CefSharp.WinForms.57.0.0\build\CefSharp.WinForms.props')" /> <Import Project="packages\CefSharp.Common.57.0.0\build\CefSharp.Common.props" Condition="Exists('packages\CefSharp.Common.57.0.0\build\CefSharp.Common.props')" /> @@ -347,6 +347,12 @@ <EmbedInteropTypes>True</EmbedInteropTypes> </COMReference> </ItemGroup> + <ItemGroup> + <ProjectReference Include="subprocess\TweetDuck.Browser.csproj"> + <Project>{b10b0017-819e-4f71-870f-8256b36a26aa}</Project> + <Name>TweetDuck.Browser</Name> + </ProjectReference> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <PropertyGroup> <PostBuildEvent>del "$(TargetPath).config" diff --git a/TweetDck.sln b/TweetDck.sln index 9f393ea0..4f89c88e 100644 --- a/TweetDck.sln +++ b/TweetDck.sln @@ -1,31 +1,31 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.40629.0 +# Visual Studio 15 +VisualStudioVersion = 15.0.26430.6 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TweetDck", "TweetDck.csproj", "{2389A7CD-E0D3-4706-8294-092929A33A2D}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TweetDuck.Browser", "subprocess\TweetDuck.Browser.csproj", "{B10B0017-819E-4F71-870F-8256B36A26AA}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "tests\UnitTests.csproj", "{A958FA7A-4A2C-42A7-BFA0-159343483F4E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2389A7CD-E0D3-4706-8294-092929A33A2D}.Debug|Any CPU.ActiveCfg = Debug|x86 {2389A7CD-E0D3-4706-8294-092929A33A2D}.Debug|x86.ActiveCfg = Debug|x86 {2389A7CD-E0D3-4706-8294-092929A33A2D}.Debug|x86.Build.0 = Debug|x86 {2389A7CD-E0D3-4706-8294-092929A33A2D}.Debug|x86.Deploy.0 = Debug|x86 - {2389A7CD-E0D3-4706-8294-092929A33A2D}.Release|Any CPU.ActiveCfg = Release|x86 {2389A7CD-E0D3-4706-8294-092929A33A2D}.Release|x86.ActiveCfg = Release|x86 {2389A7CD-E0D3-4706-8294-092929A33A2D}.Release|x86.Build.0 = Release|x86 - {A958FA7A-4A2C-42A7-BFA0-159343483F4E}.Debug|Any CPU.ActiveCfg = Debug|x86 {A958FA7A-4A2C-42A7-BFA0-159343483F4E}.Debug|x86.ActiveCfg = Debug|x86 {A958FA7A-4A2C-42A7-BFA0-159343483F4E}.Debug|x86.Build.0 = Debug|x86 - {A958FA7A-4A2C-42A7-BFA0-159343483F4E}.Release|Any CPU.ActiveCfg = Release|x86 {A958FA7A-4A2C-42A7-BFA0-159343483F4E}.Release|x86.ActiveCfg = Release|x86 + {B10B0017-819E-4F71-870F-8256B36A26AA}.Debug|x86.ActiveCfg = Debug|x86 + {B10B0017-819E-4F71-870F-8256B36A26AA}.Debug|x86.Build.0 = Debug|x86 + {B10B0017-819E-4F71-870F-8256B36A26AA}.Release|x86.ActiveCfg = Release|x86 + {B10B0017-819E-4F71-870F-8256B36A26AA}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/_postbuild.bat b/_postbuild.bat index 437aa27a..0652dfa7 100644 --- a/_postbuild.bat +++ b/_postbuild.bat @@ -1,10 +1,6 @@ del "bin\x86\Release\*.xml" del "bin\x86\Release\*.pdb" +del "bin\x86\Release\CefSharp.BrowserSubprocess.exe" del "bin\x86\Release\devtools_resources.pak" del "bin\x86\Release\d3dcompiler_43.dll" del "bin\x86\Release\widevinecdmadapter.dll" - -if exist "bin\x86\Release\CefSharp.BrowserSubprocess.exe" ( - del "bin\x86\Release\TweetDuck.Browser.exe" - ren "bin\x86\Release\CefSharp.BrowserSubprocess.exe" "TweetDuck.Browser.exe" -) diff --git a/bld/RUN BUILD.bat b/bld/RUN BUILD.bat index 5665ad60..eae396f8 100644 --- a/bld/RUN BUILD.bat +++ b/bld/RUN BUILD.bat @@ -1,8 +1,3 @@ -if exist "..\bin\x86\Release\CefSharp.BrowserSubprocess.exe" ( - del "..\bin\x86\Release\TweetDuck.Browser.exe" - ren "..\bin\x86\Release\CefSharp.BrowserSubprocess.exe" "TweetDuck.Browser.exe" -) - start "" /B "ISCC.exe" /Q "gen_full.iss" start "" /B "ISCC.exe" /Q "gen_port.iss" start "" /B "ISCC.exe" /Q "gen_upd.iss" diff --git a/bld/gen_full.iss b/bld/gen_full.iss index 0bba538c..c2380044 100644 --- a/bld/gen_full.iss +++ b/bld/gen_full.iss @@ -39,7 +39,7 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{ [Files] Source: "..\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,*.pdb,devtools_resources.pak,d3dcompiler_43.dll,widevinecdmadapter.dll" +Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,*.pdb,CefSharp.BrowserSubprocess.exe,devtools_resources.pak,d3dcompiler_43.dll,widevinecdmadapter.dll" [Icons] Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: TDIsUninstallable diff --git a/bld/gen_port.iss b/bld/gen_port.iss index b05f2461..b100a5b6 100644 --- a/bld/gen_port.iss +++ b/bld/gen_port.iss @@ -36,7 +36,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl" [Files] Source: "..\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,*.pdb,devtools_resources.pak,d3dcompiler_43.dll,widevinecdmadapter.dll" +Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,*.pdb,CefSharp.BrowserSubprocess.exe,devtools_resources.pak,d3dcompiler_43.dll,widevinecdmadapter.dll" [Run] Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall shellexec skipifsilent diff --git a/bld/gen_upd.iss b/bld/gen_upd.iss index 15821c11..5d666a5a 100644 --- a/bld/gen_upd.iss +++ b/bld/gen_upd.iss @@ -41,7 +41,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl" [Files] Source: "..\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,*.pdb,*.dll,*.pak,*.bin,*.dat" +Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,*.pdb,*.dll,*.pak,*.bin,*.dat,CefSharp.BrowserSubprocess.exe" [Icons] Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: TDIsUninstallable diff --git a/subprocess/Program.cs b/subprocess/Program.cs new file mode 100644 index 00000000..0dc869ce --- /dev/null +++ b/subprocess/Program.cs @@ -0,0 +1,20 @@ +using System; +using CefSharp.BrowserSubprocess; + +namespace TweetDuck.Browser{ + static class Program{ + private static int Main(string[] args){ + SubProcess.EnableHighDPISupport(); + + const string typePrefix = "--type="; + string type = Array.Find(args, arg => arg.StartsWith(typePrefix, StringComparison.OrdinalIgnoreCase)).Substring(typePrefix.Length); + + if (type == "renderer"){ + using(SubProcess subProcess = new SubProcess(args)){ + return subProcess.Run(); + } + } + else return SubProcess.ExecuteProcess(); + } + } +} diff --git a/subprocess/Properties/AssemblyInfo.cs b/subprocess/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..b19faa2a --- /dev/null +++ b/subprocess/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +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("TweetDuck Browser")] +[assembly: AssemblyDescription("TweetDuck Browser")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("TweetDuck.Browser")] +[assembly: AssemblyCopyright("")] +[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("b10b0017-819e-4f71-870f-8256b36a26aa")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/subprocess/TweetDuck.Browser.csproj b/subprocess/TweetDuck.Browser.csproj new file mode 100644 index 00000000..8f152fd4 --- /dev/null +++ b/subprocess/TweetDuck.Browser.csproj @@ -0,0 +1,41 @@ +<?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>{B10B0017-819E-4F71-870F-8256B36A26AA}</ProjectGuid> + <OutputType>WinExe</OutputType> + <RootNamespace>TweetDuck.Browser</RootNamespace> + <AssemblyName>TweetDuck.Browser</AssemblyName> + <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> + <PlatformTarget>x86</PlatformTarget> + <OutputPath>bin\x86\Debug\</OutputPath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> + <PlatformTarget>x86</PlatformTarget> + <OutputPath>bin\x86\Release\</OutputPath> + </PropertyGroup> + <PropertyGroup> + <StartupObject /> + </PropertyGroup> + <ItemGroup> + <Reference Include="CefSharp.BrowserSubprocess.Core"> + <HintPath>..\packages\CefSharp.Common.57.0.0\CefSharp\x86\CefSharp.BrowserSubprocess.Core.dll</HintPath> + </Reference> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <PropertyGroup> + <PostBuildEvent> + </PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file