1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-02 02:34:08 +02:00

Update CefSharp to 96 & add VC++ 2019 and UCRT DLLs to the repository

This commit is contained in:
chylex 2021-12-17 22:02:32 +01:00
parent 763c999b09
commit a94ee2fe4b
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548
57 changed files with 43 additions and 182 deletions
.gitignoreTweetDuck.csproj
Utils
app.config
bld
Redist
api-ms-win-core-console-l1-1-0.dllapi-ms-win-core-datetime-l1-1-0.dllapi-ms-win-core-debug-l1-1-0.dllapi-ms-win-core-errorhandling-l1-1-0.dllapi-ms-win-core-file-l1-1-0.dllapi-ms-win-core-file-l1-2-0.dllapi-ms-win-core-file-l2-1-0.dllapi-ms-win-core-handle-l1-1-0.dllapi-ms-win-core-heap-l1-1-0.dllapi-ms-win-core-interlocked-l1-1-0.dllapi-ms-win-core-libraryloader-l1-1-0.dllapi-ms-win-core-localization-l1-2-0.dllapi-ms-win-core-memory-l1-1-0.dllapi-ms-win-core-namedpipe-l1-1-0.dllapi-ms-win-core-processenvironment-l1-1-0.dllapi-ms-win-core-processthreads-l1-1-0.dllapi-ms-win-core-processthreads-l1-1-1.dllapi-ms-win-core-profile-l1-1-0.dllapi-ms-win-core-rtlsupport-l1-1-0.dllapi-ms-win-core-string-l1-1-0.dllapi-ms-win-core-synch-l1-1-0.dllapi-ms-win-core-synch-l1-2-0.dllapi-ms-win-core-sysinfo-l1-1-0.dllapi-ms-win-core-timezone-l1-1-0.dllapi-ms-win-core-util-l1-1-0.dllapi-ms-win-crt-conio-l1-1-0.dllapi-ms-win-crt-convert-l1-1-0.dllapi-ms-win-crt-environment-l1-1-0.dllapi-ms-win-crt-filesystem-l1-1-0.dllapi-ms-win-crt-heap-l1-1-0.dllapi-ms-win-crt-locale-l1-1-0.dllapi-ms-win-crt-math-l1-1-0.dllapi-ms-win-crt-multibyte-l1-1-0.dllapi-ms-win-crt-private-l1-1-0.dllapi-ms-win-crt-process-l1-1-0.dllapi-ms-win-crt-runtime-l1-1-0.dllapi-ms-win-crt-stdio-l1-1-0.dllapi-ms-win-crt-string-l1-1-0.dllapi-ms-win-crt-time-l1-1-0.dllapi-ms-win-crt-utility-l1-1-0.dllconcrt140.dllmsvcp140.dllmsvcp140_1.dllmsvcp140_2.dllmsvcp140_atomic_wait.dllmsvcp140_codecvt_ids.dllucrtbase.dllvccorlib140.dllvcruntime140.dll
gen_full.issgen_port.iss
packages.config
subprocess

2
.gitignore vendored
View File

@ -5,6 +5,7 @@
bld/* bld/*
!bld/*.iss !bld/*.iss
!bld/*.bat !bld/*.bat
!bld/Redist
!bld/Resources !bld/Resources
# Rider # Rider
@ -144,4 +145,3 @@ _UpgradeReport_Files/
Backup*/ Backup*/
UpgradeLog*.XML UpgradeLog*.XML
UpgradeLog*.htm UpgradeLog*.htm

View File

@ -1,9 +1,9 @@
<?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"> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="packages\CefSharp.Common.96.0.180\build\CefSharp.Common.props" Condition="Exists('packages\CefSharp.Common.96.0.180\build\CefSharp.Common.props')" />
<Import Project="packages\cef.redist.x86.96.0.18\build\cef.redist.x86.props" Condition="Exists('packages\cef.redist.x86.96.0.18\build\cef.redist.x86.props')" />
<Import Project="packages\cef.redist.x64.96.0.18\build\cef.redist.x64.props" Condition="Exists('packages\cef.redist.x64.96.0.18\build\cef.redist.x64.props')" />
<Import Project="packages\CefSharp.WinForms.92.0.260\build\CefSharp.WinForms.props" Condition="Exists('packages\CefSharp.WinForms.92.0.260\build\CefSharp.WinForms.props')" /> <Import Project="packages\CefSharp.WinForms.92.0.260\build\CefSharp.WinForms.props" Condition="Exists('packages\CefSharp.WinForms.92.0.260\build\CefSharp.WinForms.props')" />
<Import Project="packages\CefSharp.Common.92.0.260\build\CefSharp.Common.props" Condition="Exists('packages\CefSharp.Common.92.0.260\build\CefSharp.Common.props')" />
<Import Project="packages\cef.redist.x86.92.0.26\build\cef.redist.x86.props" Condition="Exists('packages\cef.redist.x86.92.0.26\build\cef.redist.x86.props')" />
<Import Project="packages\cef.redist.x64.92.0.26\build\cef.redist.x64.props" Condition="Exists('packages\cef.redist.x64.92.0.26\build\cef.redist.x64.props')" />
<Import Project="packages\Microsoft.Net.Compilers.3.0.0\build\Microsoft.Net.Compilers.props" Condition="Exists('packages\Microsoft.Net.Compilers.3.0.0\build\Microsoft.Net.Compilers.props')" /> <Import Project="packages\Microsoft.Net.Compilers.3.0.0\build\Microsoft.Net.Compilers.props" Condition="Exists('packages\Microsoft.Net.Compilers.3.0.0\build\Microsoft.Net.Compilers.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
@ -45,14 +45,14 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="CefSharp, Version=92.0.260.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL"> <Reference Include="CefSharp, Version=96.0.180.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
<HintPath>packages\CefSharp.Common.92.0.260\lib\net452\CefSharp.dll</HintPath> <HintPath>packages\CefSharp.Common.96.0.180\lib\net452\CefSharp.dll</HintPath>
</Reference> </Reference>
<Reference Include="CefSharp.Core, Version=92.0.260.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL"> <Reference Include="CefSharp.Core, Version=96.0.180.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
<HintPath>packages\CefSharp.Common.92.0.260\lib\net452\CefSharp.Core.dll</HintPath> <HintPath>packages\CefSharp.Common.96.0.180\lib\net452\CefSharp.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="CefSharp.WinForms, Version=92.0.260.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL"> <Reference Include="CefSharp.WinForms, Version=96.0.180.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
<HintPath>packages\CefSharp.WinForms.92.0.260\lib\net452\CefSharp.WinForms.dll</HintPath> <HintPath>packages\CefSharp.WinForms.96.0.180\lib\net462\CefSharp.WinForms.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@ -318,6 +318,7 @@
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" />
<None Include="packages.config" /> <None Include="packages.config" />
<None Include="Resources\Images\avatar.png" /> <None Include="Resources\Images\avatar.png" />
<None Include="Resources\Images\icon-muted.ico" /> <None Include="Resources\Images\icon-muted.ico" />
@ -375,6 +376,9 @@
<None Include="Resources\Scripts\twitter.js" /> <None Include="Resources\Scripts\twitter.js" />
<None Include="Resources\Scripts\update.js" /> <None Include="Resources\Scripts\update.js" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Redist Include="$(ProjectDir)bld\Redist\*.*" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="lib\TweetLib.Core\TweetLib.Core.csproj"> <ProjectReference Include="lib\TweetLib.Core\TweetLib.Core.csproj">
<Project>{93ba3cb4-a812-4949-b07d-8d393fb38937}</Project> <Project>{93ba3cb4-a812-4949-b07d-8d393fb38937}</Project>
@ -416,6 +420,7 @@ IF EXIST "$(ProjectDir)bld\post_build.exe" (
<Exec Command="del &quot;$(TargetDir)*.xml&quot;" /> <Exec Command="del &quot;$(TargetDir)*.xml&quot;" />
<Delete Files="$(TargetDir)CefSharp.BrowserSubprocess.exe" /> <Delete Files="$(TargetDir)CefSharp.BrowserSubprocess.exe" />
<Delete Files="$(TargetDir)widevinecdmadapter.dll" /> <Delete Files="$(TargetDir)widevinecdmadapter.dll" />
<Copy SourceFiles="@(Redist)" DestinationFolder="$(TargetDir)" />
<Exec Command="start &quot;&quot; /B &quot;ISCC.exe&quot; /Q &quot;$(ProjectDir)bld\gen_upd.iss&quot;" WorkingDirectory="$(ProjectDir)bld\" IgnoreExitCode="true" /> <Exec Command="start &quot;&quot; /B &quot;ISCC.exe&quot; /Q &quot;$(ProjectDir)bld\gen_upd.iss&quot;" WorkingDirectory="$(ProjectDir)bld\" IgnoreExitCode="true" />
</Target> </Target>
<PropertyGroup> <PropertyGroup>
@ -426,10 +431,10 @@ IF EXIST "$(ProjectDir)bld\post_build.exe" (
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('packages\Microsoft.Net.Compilers.3.0.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Net.Compilers.3.0.0\build\Microsoft.Net.Compilers.props'))" /> <Error Condition="!Exists('packages\Microsoft.Net.Compilers.3.0.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Net.Compilers.3.0.0\build\Microsoft.Net.Compilers.props'))" />
<Error Condition="!Exists('packages\cef.redist.x64.92.0.26\build\cef.redist.x64.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\cef.redist.x64.92.0.26\build\cef.redist.x64.props'))" /> <Error Condition="!Exists('packages\cef.redist.x64.96.0.18\build\cef.redist.x64.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\cef.redist.x64.96.0.18\build\cef.redist.x64.props'))" />
<Error Condition="!Exists('packages\cef.redist.x86.92.0.26\build\cef.redist.x86.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\cef.redist.x86.92.0.26\build\cef.redist.x86.props'))" /> <Error Condition="!Exists('packages\cef.redist.x86.96.0.18\build\cef.redist.x86.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\cef.redist.x86.96.0.18\build\cef.redist.x86.props'))" />
<Error Condition="!Exists('packages\CefSharp.Common.92.0.260\build\CefSharp.Common.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.Common.92.0.260\build\CefSharp.Common.props'))" /> <Error Condition="!Exists('packages\CefSharp.Common.96.0.180\build\CefSharp.Common.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.Common.96.0.180\build\CefSharp.Common.props'))" />
<Error Condition="!Exists('packages\CefSharp.Common.92.0.260\build\CefSharp.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.Common.92.0.260\build\CefSharp.Common.targets'))" /> <Error Condition="!Exists('packages\CefSharp.Common.96.0.180\build\CefSharp.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.Common.96.0.180\build\CefSharp.Common.targets'))" />
</Target> </Target>
<Import Project="packages\CefSharp.Common.92.0.260\build\CefSharp.Common.targets" Condition="Exists('packages\CefSharp.Common.92.0.260\build\CefSharp.Common.targets')" /> <Import Project="packages\CefSharp.Common.96.0.180\build\CefSharp.Common.targets" Condition="Exists('packages\CefSharp.Common.96.0.180\build\CefSharp.Common.targets')" />
</Project> </Project>

View File

@ -34,6 +34,7 @@ public static void SetupCefArgs(IDictionary<string, string> args) {
args["disable-touch-adjustment"] = "1"; args["disable-touch-adjustment"] = "1";
} }
args["disable-component-update"] = "1";
args["disable-pdf-extension"] = "1"; args["disable-pdf-extension"] = "1";
args["disable-plugins-discovery"] = "1"; args["disable-plugins-discovery"] = "1";
args["enable-system-flash"] = "0"; args["enable-system-flash"] = "0";

11
app.config Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="CefSharp" publicKeyToken="40c4b6fc221f4138" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-96.0.180.0" newVersion="96.0.180.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bld/Redist/concrt140.dll Normal file

Binary file not shown.

BIN
bld/Redist/msvcp140.dll Normal file

Binary file not shown.

BIN
bld/Redist/msvcp140_1.dll Normal file

Binary file not shown.

BIN
bld/Redist/msvcp140_2.dll Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bld/Redist/ucrtbase.dll Normal file

Binary file not shown.

BIN
bld/Redist/vccorlib140.dll Normal file

Binary file not shown.

BIN
bld/Redist/vcruntime140.dll Normal file

Binary file not shown.

View File

@ -8,7 +8,6 @@
#define MyAppExeName "TweetDuck.exe" #define MyAppExeName "TweetDuck.exe"
#define MyAppVersion GetFileVersion("..\bin\x86\Release\TweetDuck.exe") #define MyAppVersion GetFileVersion("..\bin\x86\Release\TweetDuck.exe")
#define VCRedistLink "releases/download/1.13/vc_redist.x86.exe"
[Setup] [Setup]
AppId={{8C25A716-7E11-4AAD-9992-8B5D0C78AE06} AppId={{8C25A716-7E11-4AAD-9992-8B5D0C78AE06}
@ -66,18 +65,14 @@ AdditionalTasks=Additional shortcuts and components:
[Code] [Code]
var UpdatePath: String; var UpdatePath: String;
var ForceRedistPrompt: String;
var VisitedTasksPage: Boolean; var VisitedTasksPage: Boolean;
function TDGetNetFrameworkVersion: Cardinal; forward; function TDGetNetFrameworkVersion: Cardinal; forward;
function TDIsVCMissing: Boolean; forward;
procedure TDInstallVCRedist; forward;
{ Check .NET Framework version on startup, ask user if they want to proceed if older than 4.7.2. } { Check .NET Framework version on startup, ask user if they want to proceed if older than 4.7.2. }
function InitializeSetup: Boolean; function InitializeSetup: Boolean;
begin begin
UpdatePath := ExpandConstant('{param:UPDATEPATH}') UpdatePath := ExpandConstant('{param:UPDATEPATH}')
ForceRedistPrompt := ExpandConstant('{param:PROMPTREDIST}')
VisitedTasksPage := False VisitedTasksPage := False
if (TDGetNetFrameworkVersion() < 461808) and (MsgBox('{#MyAppName} requires .NET Framework 4.7.2 or newer,'+#13+#10+'please visit {#MyAppShortURL} for a download link.'+#13+#10+#13+#10'Do you want to proceed with the setup anyway?', mbCriticalError, MB_YESNO or MB_DEFBUTTON2) = IDNO) then if (TDGetNetFrameworkVersion() < 461808) and (MsgBox('{#MyAppName} requires .NET Framework 4.7.2 or newer,'+#13+#10+'please visit {#MyAppShortURL} for a download link.'+#13+#10+#13+#10'Do you want to proceed with the setup anyway?', mbCriticalError, MB_YESNO or MB_DEFBUTTON2) = IDNO) then
@ -86,11 +81,6 @@ begin
Exit Exit
end; end;
if (TDIsVCMissing() or (ForceRedistPrompt = '1')) and (MsgBox('Microsoft Visual C++ 2015 appears to be missing, would you like to automatically install it?', mbConfirmation, MB_YESNO) = IDYES) then
begin
idpAddFile('https://github.com/{#MyAppPublisher}/{#MyAppName}/{#VCRedistLink}', ExpandConstant('{tmp}\{#MyAppName}.VC.exe'))
end;
Result := True Result := True
end; end;
@ -124,15 +114,6 @@ begin
end; end;
end; end;
{ Install VC++ if downloaded. }
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssInstall then
begin
TDInstallVCRedist()
end;
end;
{ Ask user if they want to delete 'AppData\TweetDuck' and 'plugins' folders after uninstallation. } { Ask user if they want to delete 'AppData\TweetDuck' and 'plugins' folders after uninstallation. }
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var ProfileDataFolder: String; var ProfileDataFolder: String;
@ -172,65 +153,3 @@ begin
Result := 0 Result := 0
end; end;
{ Check if Visual C++ 2015 or 2017 is installed. }
function TDIsVCMissing: Boolean;
var Keys: TArrayOfString;
var Index: Integer;
var Key: String;
var DisplayName: String;
begin
if RegGetSubkeyNames(HKEY_LOCAL_MACHINE, 'Software\Classes\Installer\Dependencies', Keys) then
begin
for Index := 0 to GetArrayLength(Keys)-1 do
begin
Key := Keys[Index]
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Classes\Installer\Dependencies\'+Key, 'DisplayName', DisplayName) then
begin
if (Pos('Microsoft Visual C++', DisplayName) = 1) and (Pos('(x86)', DisplayName) > 1) and ((Pos(' 2015 ', DisplayName) > 1) or (Pos(' 2017 ', DisplayName) > 1)) then
begin
Result := False
Exit
end;
end;
end;
end;
Result := True
end;
{ Run the Visual C++ installer if downloaded. }
procedure TDInstallVCRedist;
var InstallFile: String;
var ResultCode: Integer;
begin
InstallFile := ExpandConstant('{tmp}\{#MyAppName}.VC.exe')
if FileExists(InstallFile) then
begin
WizardForm.ProgressGauge.Style := npbstMarquee
try
if Exec(InstallFile, '/passive /norestart', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
if ResultCode <> 0 then
begin
DeleteFile(InstallFile)
Exit
end;
end else
begin
MsgBox('Could not run the Visual C++ installer, please visit https://github.com/{#MyAppPublisher}/{#MyAppName}/{#VCRedistLink} and download the latest version manually. Error: '+SysErrorMessage(ResultCode), mbCriticalError, MB_OK);
DeleteFile(InstallFile)
Exit
end;
finally
WizardForm.ProgressGauge.Style := npbstNormal
DeleteFile(InstallFile)
end;
end;
end;

View File

@ -8,7 +8,6 @@
#define MyAppExeName "TweetDuck.exe" #define MyAppExeName "TweetDuck.exe"
#define MyAppVersion GetFileVersion("..\bin\x86\Release\TweetDuck.exe") #define MyAppVersion GetFileVersion("..\bin\x86\Release\TweetDuck.exe")
#define VCRedistLink "releases/download/1.13/vc_redist.x86.exe"
[Setup] [Setup]
AppId={{8C25A716-7E11-4AAD-9992-8B5D0C78AE06} AppId={{8C25A716-7E11-4AAD-9992-8B5D0C78AE06}
@ -52,17 +51,13 @@ AdditionalTasks=Additional components:
[Code] [Code]
var UpdatePath: String; var UpdatePath: String;
var ForceRedistPrompt: String;
function TDGetNetFrameworkVersion: Cardinal; forward; function TDGetNetFrameworkVersion: Cardinal; forward;
function TDIsVCMissing: Boolean; forward;
procedure TDInstallVCRedist; forward;
{ Check .NET Framework version on startup, ask user if they want to proceed if older than 4.7.2. } { Check .NET Framework version on startup, ask user if they want to proceed if older than 4.7.2. }
function InitializeSetup: Boolean; function InitializeSetup: Boolean;
begin begin
UpdatePath := ExpandConstant('{param:UPDATEPATH}') UpdatePath := ExpandConstant('{param:UPDATEPATH}')
ForceRedistPrompt := ExpandConstant('{param:PROMPTREDIST}')
if (TDGetNetFrameworkVersion() < 461808) and (MsgBox('{#MyAppName} requires .NET Framework 4.7.2 or newer,'+#13+#10+'please visit {#MyAppShortURL} for a download link.'+#13+#10+#13+#10'Do you want to proceed with the setup anyway?', mbCriticalError, MB_YESNO or MB_DEFBUTTON2) = IDNO) then if (TDGetNetFrameworkVersion() < 461808) and (MsgBox('{#MyAppName} requires .NET Framework 4.7.2 or newer,'+#13+#10+'please visit {#MyAppShortURL} for a download link.'+#13+#10+#13+#10'Do you want to proceed with the setup anyway?', mbCriticalError, MB_YESNO or MB_DEFBUTTON2) = IDNO) then
begin begin
@ -70,11 +65,6 @@ begin
Exit Exit
end; end;
if (TDIsVCMissing() or (ForceRedistPrompt = '1')) and (MsgBox('Microsoft Visual C++ 2015 appears to be missing, would you like to automatically install it?', mbConfirmation, MB_YESNO) = IDYES) then
begin
idpAddFile('https://github.com/{#MyAppPublisher}/{#MyAppName}/{#VCRedistLink}', ExpandConstant('{tmp}\{#MyAppName}.VC.exe'))
end;
Result := True Result := True
end; end;
@ -98,13 +88,10 @@ begin
Result := (PageID = wpSelectDir) and (UpdatePath <> '') Result := (PageID = wpSelectDir) and (UpdatePath <> '')
end; end;
{ Install VC++ if downloaded, and create a 'makeportable' file for portable installs. } { Create a 'makeportable' file for portable installs. }
procedure CurStepChanged(CurStep: TSetupStep); procedure CurStepChanged(CurStep: TSetupStep);
begin begin
if CurStep = ssInstall then if CurStep = ssPostInstall then
begin
TDInstallVCRedist();
end else if CurStep = ssPostInstall then
begin begin
while not SaveStringToFile(ExpandConstant('{app}\makeportable'), '', False) do while not SaveStringToFile(ExpandConstant('{app}\makeportable'), '', False) do
begin begin
@ -129,65 +116,3 @@ begin
Result := 0 Result := 0
end; end;
{ Check if Visual C++ 2015 or 2017 is installed. }
function TDIsVCMissing: Boolean;
var Keys: TArrayOfString;
var Index: Integer;
var Key: String;
var DisplayName: String;
begin
if RegGetSubkeyNames(HKEY_LOCAL_MACHINE, 'Software\Classes\Installer\Dependencies', Keys) then
begin
for Index := 0 to GetArrayLength(Keys)-1 do
begin
Key := Keys[Index]
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Classes\Installer\Dependencies\'+Key, 'DisplayName', DisplayName) then
begin
if (Pos('Microsoft Visual C++', DisplayName) = 1) and (Pos('(x86)', DisplayName) > 1) and ((Pos(' 2015 ', DisplayName) > 1) or (Pos(' 2017 ', DisplayName) > 1)) then
begin
Result := False
Exit
end;
end;
end;
end;
Result := True
end;
{ Run the Visual C++ installer if downloaded. }
procedure TDInstallVCRedist;
var InstallFile: String;
var ResultCode: Integer;
begin
InstallFile := ExpandConstant('{tmp}\{#MyAppName}.VC.exe')
if FileExists(InstallFile) then
begin
WizardForm.ProgressGauge.Style := npbstMarquee
try
if Exec(InstallFile, '/passive /norestart', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
if ResultCode <> 0 then
begin
DeleteFile(InstallFile)
Exit
end;
end else
begin
MsgBox('Could not run the Visual C++ installer, please visit https://github.com/{#MyAppPublisher}/{#MyAppName}/{#VCRedistLink} and download the latest version manually. Error: '+SysErrorMessage(ResultCode), mbCriticalError, MB_OK);
DeleteFile(InstallFile)
Exit
end;
finally
WizardForm.ProgressGauge.Style := npbstNormal
DeleteFile(InstallFile)
end;
end;
end;

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="cef.redist.x64" version="92.0.26" targetFramework="net472" /> <package id="cef.redist.x64" version="96.0.18" targetFramework="net472" />
<package id="cef.redist.x86" version="92.0.26" targetFramework="net472" /> <package id="cef.redist.x86" version="96.0.18" targetFramework="net472" />
<package id="CefSharp.Common" version="92.0.260" targetFramework="net472" /> <package id="CefSharp.Common" version="96.0.180" targetFramework="net472" />
<package id="CefSharp.WinForms" version="92.0.260" targetFramework="net472" /> <package id="CefSharp.WinForms" version="96.0.180" targetFramework="net472" />
<package id="Microsoft.Net.Compilers" version="3.0.0" targetFramework="net472" developmentDependency="true" /> <package id="Microsoft.Net.Compilers" version="3.0.0" targetFramework="net472" developmentDependency="true" />
</packages> </packages>

View File

@ -29,13 +29,13 @@
<StartupObject /> <StartupObject />
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="CefSharp, Version=92.0.260, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=x86"> <Reference Include="CefSharp, Version=96.0.260, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\CefSharp.Common.92.0.260\lib\net452\CefSharp.dll</HintPath> <HintPath>..\packages\CefSharp.Common.96.0.180\lib\net452\CefSharp.dll</HintPath>
</Reference> </Reference>
<Reference Include="CefSharp.BrowserSubprocess.Core, Version=92.0.260, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=x86"> <Reference Include="CefSharp.BrowserSubprocess.Core, Version=96.0.260, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\CefSharp.Common.92.0.260\CefSharp\x86\CefSharp.BrowserSubprocess.Core.dll</HintPath> <HintPath>..\packages\CefSharp.Common.96.0.180\CefSharp\x86\CefSharp.BrowserSubprocess.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
</ItemGroup> </ItemGroup>