FILE_IN_CABINET_INFO_W *pInfo;
FILEPATHS_W *pFilePaths;
+ DBG_UNREFERENCED_LOCAL_VARIABLE(pFilePaths);
+
switch(Notification)
{
case SPFILENOTIFY_FILEINCABINET:
{
SHFILEOPSTRUCT fileop;
DWORD len = wcslen(lpszDir);
- WCHAR *pszFrom = HeapAlloc(GetProcessHeap(), 0, (len + 2) * sizeof(WCHAR));
+ WCHAR *pszFrom = HeapAlloc(GetProcessHeap(), 0, (len + 2) * sizeof(WCHAR));
int ret;
wcscpy(pszFrom, lpszDir);
fileop.hNameMappings = NULL;
ret = SHFileOperation(&fileop);
- HeapFree(GetProcessHeap(), 0, &pszFrom);
+ HeapFree(GetProcessHeap(), 0, pszFrom);
return (ret == 0);
}
STARTUPINFO startupInfo;
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(nCmdShow);
-
+
GetCurrentDirectory(MAX_PATH, szSetupPath);
wcscat(szSetupPath, L"\\");
wcscpy(szFileName, szSetupPath);
wcscat(szFileName, L"setup.lst");
-
+
if (GetFileAttributes(szFileName) == INVALID_FILE_ATTRIBUTES)
{
MessageBoxW(0, L"Cannot find Setup.lst file", L"Error", MB_OK | MB_ICONERROR);
return 1;
}
-
+
/* read information from setup.lst */
GetPrivateProfileStringW(NT_PARAMS, L"CabinetFile", NULL, szCabFileName, MAX_PATH, szFileName);
GetPrivateProfileStringW(NT_PARAMS, L"TmpDirName", NULL, szTempDirName, 50, szFileName);
GetPrivateProfileStringW(NT_PARAMS, L"CmdLine", NULL, szCmdLine, MAX_PATH, szFileName);
-
+
wcscpy(szCabFilePath, szSetupPath);
wcscat(szCabFilePath, szCabFileName);
-
+
/* ceate temp directory */
GetSystemDrive(szDrive);
wcscpy(szTempPath, szDrive);
wcscpy(szFullTempPath, szTempPath);
wcscat(szFullTempPath, szTempDirName);
wcscat(szFullTempPath, L"\\");
-
+
if (SHCreateDirectoryEx(0, szFullTempPath, NULL) != ERROR_SUCCESS)
{
MessageBoxW(0, L"Could not create Temp Directory.", L"Error", MB_OK | MB_ICONERROR);
return 1;
- }
+ }
dwAttrib = GetFileAttributes(szTempPath);
SetFileAttributes(szTempPath, dwAttrib | FILE_ATTRIBUTE_HIDDEN);
-
+
/* extract files */
if (!SetupIterateCabinetW(szCabFilePath, 0, ExtCabCallback, szFullTempPath))
{
DeleteDirectory(szTempPath);
return 1;
}
-
+
/* prepare command line */
wsprintf(szTempCmdLine, szCmdLine, szFullTempPath, lpCmdLine);
wcscpy(szCmdLine, szFullTempPath);
wcscat(szCmdLine, szTempCmdLine);
-
+
/* execute the 32-Bit installer */
ZeroMemory(&processInfo, sizeof(processInfo));
ZeroMemory(&startupInfo, sizeof(startupInfo));
else
{
WCHAR szMsg[MAX_PATH];
- wsprintf(szMsg, L"Failed to load the installer. Error %d", GetLastError());
+ wsprintf(szMsg, L"Failed to load the installer. Error %lu", GetLastError());
MessageBoxW(0, szMsg, L"Error", MB_OK | MB_ICONERROR);
DeleteDirectory(szTempPath);
return 1;
}
-
+
/* cleanup */
DeleteDirectory(szTempPath);
-
+
return 0;
}