mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Fix up things suggested in Code Review
This commit is contained in:
@@ -3,15 +3,14 @@
|
||||
#include "resource.h"
|
||||
|
||||
// http://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx#net_b
|
||||
const wchar_t* ndpPath = L"SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full";
|
||||
const int fx45ReleaseVersion = 378389;
|
||||
static const wchar_t* ndpPath = L"SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full";
|
||||
static const int fx45ReleaseVersion = 378389;
|
||||
|
||||
bool CFxHelper::IsDotNet45OrHigherInstalled(void)
|
||||
bool CFxHelper::IsDotNet45OrHigherInstalled()
|
||||
{
|
||||
ATL::CRegKey key;
|
||||
|
||||
if (key.Open(HKEY_LOCAL_MACHINE, ndpPath, KEY_READ) != ERROR_SUCCESS) {
|
||||
DWORD dwErr = GetLastError();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
class CFxHelper
|
||||
{
|
||||
public:
|
||||
static bool IsDotNet45OrHigherInstalled(void);
|
||||
static bool IsDotNet45OrHigherInstalled();
|
||||
static void HelpUserInstallDotNetFramework(bool isQuiet);
|
||||
};
|
||||
|
||||
|
||||
@@ -23,11 +23,9 @@ int CUpdateRunner::ExtractUpdaterAndRun(wchar_t* lpCommandLine)
|
||||
CResource zipResource;
|
||||
wchar_t targetDir[MAX_PATH];
|
||||
|
||||
ExpandEnvironmentStrings(L"%LocalAppData%\\SquirrelTemp", targetDir, MAX_PATH);
|
||||
if (GetFileAttributes(targetDir) == INVALID_FILE_ATTRIBUTES) {
|
||||
if (!CreateDirectory(targetDir, NULL)) {
|
||||
goto failedExtract;
|
||||
}
|
||||
ExpandEnvironmentStrings(L"%LocalAppData%\\SquirrelTemp", targetDir, _countof(targetDir));
|
||||
if (!CreateDirectory(targetDir, NULL) && GetLastError() != ERROR_ALREADY_EXISTS) {
|
||||
goto failedExtract;
|
||||
}
|
||||
|
||||
if (!zipResource.Load(L"DATA", IDR_UPDATE_ZIP)) {
|
||||
@@ -45,9 +43,10 @@ int CUpdateRunner::ExtractUpdaterAndRun(wchar_t* lpCommandLine)
|
||||
|
||||
// NB: This library is kind of a disaster
|
||||
ZRESULT zr;
|
||||
ZIPENTRY zentry;
|
||||
int index = 0;
|
||||
do {
|
||||
ZIPENTRY zentry;
|
||||
|
||||
zr = GetZipItem(zipFile, index, &zentry);
|
||||
if (zr != ZR_OK && zr != ZR_MORE) {
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user