diff --git a/VisualDiskImager.png b/VisualDiskImager.png index 0759c27..aa0f777 100644 Binary files a/VisualDiskImager.png and b/VisualDiskImager.png differ diff --git a/VisualDiskImager/VisualDiskImager.rc b/VisualDiskImager/VisualDiskImager.rc index ac8918f..74badf4 100644 Binary files a/VisualDiskImager/VisualDiskImager.rc and b/VisualDiskImager/VisualDiskImager.rc differ diff --git a/VisualDiskImager/VisualDiskImager.vcxproj b/VisualDiskImager/VisualDiskImager.vcxproj index b9d6b66..afb5399 100644 --- a/VisualDiskImager/VisualDiskImager.vcxproj +++ b/VisualDiskImager/VisualDiskImager.vcxproj @@ -31,7 +31,7 @@ true v143 Unicode - Static + Dynamic true @@ -40,14 +40,14 @@ v143 true Unicode - Static + Dynamic Application true v143 Unicode - Static + Dynamic true @@ -56,7 +56,7 @@ v143 true Unicode - Static + Dynamic diff --git a/VisualDiskImager/VisualDiskImagerDlg.cpp b/VisualDiskImager/VisualDiskImagerDlg.cpp index 717ae18..7925f8a 100644 --- a/VisualDiskImager/VisualDiskImagerDlg.cpp +++ b/VisualDiskImager/VisualDiskImagerDlg.cpp @@ -417,12 +417,12 @@ void CVisualDiskImagerDlg::OnDropFiles(HDROP hDropInfo) UpdateData( FALSE ); + UpdateInterface(); + DragFinish( hDropInfo ); return; } - UpdateInterface(); - CDialogExSized::OnDropFiles( hDropInfo ); } diff --git a/VisualDiskImager/framework.h b/VisualDiskImager/framework.h index 6308417..08a4391 100644 --- a/VisualDiskImager/framework.h +++ b/VisualDiskImager/framework.h @@ -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" diff --git a/setup/setup.iss b/setup/setup.iss index 384547b..81cb8e0 100644 --- a/setup/setup.iss +++ b/setup/setup.iss @@ -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" diff --git a/setup/vcredist.iss b/setup/vcredist.iss new file mode 100644 index 0000000..d242c52 --- /dev/null +++ b/setup/vcredist.iss @@ -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;