Skip to content

Commit

Permalink
Fixed compatibility with Windows XP.
Browse files Browse the repository at this point in the history
  • Loading branch information
raspopov committed Jul 23, 2024
1 parent 242d387 commit dba34ce
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 8 deletions.
Binary file modified VisualDiskImager.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified VisualDiskImager/VisualDiskImager.rc
Binary file not shown.
8 changes: 4 additions & 4 deletions VisualDiskImager/VisualDiskImager.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Static</UseOfMfc>
<UseOfMfc>Dynamic</UseOfMfc>
<EnableASAN>true</EnableASAN>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
Expand All @@ -40,14 +40,14 @@
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Static</UseOfMfc>
<UseOfMfc>Dynamic</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Static</UseOfMfc>
<UseOfMfc>Dynamic</UseOfMfc>
<EnableASAN>true</EnableASAN>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
Expand All @@ -56,7 +56,7 @@
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Static</UseOfMfc>
<UseOfMfc>Dynamic</UseOfMfc>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down
4 changes: 2 additions & 2 deletions VisualDiskImager/VisualDiskImagerDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,12 +417,12 @@ void CVisualDiskImagerDlg::OnDropFiles(HDROP hDropInfo)

UpdateData( FALSE );

UpdateInterface();

DragFinish( hDropInfo );
return;
}

UpdateInterface();

CDialogExSized::OnDropFiles( hDropInfo );
}

Expand Down
8 changes: 6 additions & 2 deletions VisualDiskImager/framework.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ along with this program.If not, see < http://www.gnu.org/licenses/>.

#pragma once

#ifndef STRICT
#define STRICT
#endif

#ifndef _SECURE_ATL
#define _SECURE_ATL 1
#define _SECURE_ATL 1
#endif

#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#endif

#include "targetver.h"
Expand Down
2 changes: 2 additions & 0 deletions setup/setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@ Name: "{app}"; Type: dirifempty
Name: "{pf}\{#MyAppPublisher}"; Type: dirifempty
Name: "{localappdata}\{#MyAppPublisher}\{#MyAppName}"; Type: filesandordirs
Name: "{localappdata}\{#MyAppPublisher}"; Type: dirifempty

#include "vcredist.iss"
31 changes: 31 additions & 0 deletions setup/vcredist.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#ifndef Platform
#error "Platform" predefined variable must be defined (x64/Win32)
#endif

#if Platform == "x64"
#define vcredist_exe "VC_redist.x64.exe"
#define vcredist_url "https://aka.ms/vs/15/release/VC_redist.x64.exe"
#else
#define vcredist_exe "VC_redist.x86.exe"
#define vcredist_url "https://aka.ms/vs/15/release/VC_redist.x86.exe"
#endif

#define vcredist_path ExtractFilePath(__PATHFILENAME__) + '\' + vcredist_exe

; Download file if not exists
#expr Exec( 'powershell', '-NoProfile -Command if (!(Test-Path \"' + vcredist_path + '\")){(New-Object System.Net.WebClient).DownloadFile(\"' + vcredist_url + '\",\"' + vcredist_path + '\")}' )

[Files]
#if Platform == "x64"
Source: "{#vcredist_path}"; DestDir: "{tmp}"; Flags: deleteafterinstall 64bit; Check: IsWin64; AfterInstall: ExecTemp( '{#vcredist_exe}', '/passive /norestart' );
#else
Source: "{#vcredist_path}"; DestDir: "{tmp}"; Flags: deleteafterinstall 32bit; AfterInstall: ExecTemp( '{#vcredist_exe}', '/passive /norestart' );
#endif

[Code]
procedure ExecTemp(File, Params : String);
var
nCode: Integer;
begin
Exec( ExpandConstant( '{tmp}' ) + '\' + File, Params, ExpandConstant( '{tmp}' ), SW_SHOW, ewWaitUntilTerminated, nCode );
end;

0 comments on commit dba34ce

Please sign in to comment.