diff options
author | amit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-08 16:49:39 +0000 |
---|---|---|
committer | amit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-08 16:49:39 +0000 |
commit | a692b4f10a1d866f73645312234477f124c90900 (patch) | |
tree | 3608ecf28da97d315a40a5d8ccaae6d78f0abc5d /chrome/installer/mini_installer | |
parent | 1a0f04beab1294fed417320fb53f27e9e8be1df5 (diff) | |
download | chromium_src-a692b4f10a1d866f73645312234477f124c90900.zip chromium_src-a692b4f10a1d866f73645312234477f124c90900.tar.gz chromium_src-a692b4f10a1d866f73645312234477f124c90900.tar.bz2 |
Remove need to invoke expand.exe from mini_installer.
Error 102 (0x66) has one of the highest occurances in setup failures.
Once reason could be failure to successfully invoke expand.exe to
extract setup.exe.
Hopefully this should make this step more reliable.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6250175
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74125 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/mini_installer')
-rw-r--r-- | chrome/installer/mini_installer/mini_installer.cc | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/chrome/installer/mini_installer/mini_installer.cc b/chrome/installer/mini_installer/mini_installer.cc index e5d7fda..a898f30 100644 --- a/chrome/installer/mini_installer/mini_installer.cc +++ b/chrome/installer/mini_installer/mini_installer.cc @@ -29,7 +29,8 @@ #pragma comment(linker, "/MERGE:.rdata=.text") #include <windows.h> -#include <Shellapi.h> +#include <setupapi.h> +#include <shellapi.h> #include <shlwapi.h> #include "chrome/installer/mini_installer/appid.h" @@ -506,27 +507,16 @@ bool UnpackBinaryResources(HMODULE module, const wchar_t* base_path, return false; if (::lstrlen(setup_path) > 0) { - // Uncompress LZ compressed resource using the existing - // program in the system32 folder named 'expand.exe'. - wchar_t expand_cmd[MAX_PATH * 3] = {0}; - if (!SafeStrCopy(expand_cmd, _countof(expand_cmd), UNCOMPRESS_CMD) || - !SafeStrCat(expand_cmd, _countof(expand_cmd), L"\"") || - !SafeStrCat(expand_cmd, _countof(expand_cmd), setup_path) || - !SafeStrCat(expand_cmd, _countof(expand_cmd), L"\" \"") || - !SafeStrCat(expand_cmd, _countof(expand_cmd), setup_dest_path) || - !SafeStrCat(expand_cmd, _countof(expand_cmd), L"\"")) - return false; - - // If we fail to uncompress the file, exit now and leave the file - // behind for postmortem analysis. - int exit_code = 0; - if (!RunProcessAndWait(NULL, expand_cmd, &exit_code) || - (exit_code != 0)) + // Uncompress LZ compressed resource. Setup is packed with 'MSCF' + // as opposed to old DOS way of 'SZDD'. Hence use SetupInstallFile + // instead of LZCopy. + // Note that the API will automatically delete the original file + // if the extraction was successful. + if (!SetupInstallFile(NULL, NULL, setup_path, NULL, setup_dest_path, + SP_COPY_DELETESOURCE | SP_COPY_SOURCE_ABSOLUTE, + NULL, NULL)) return false; - // Uncompression was successful, delete the source but it is not critical - // if that fails. - ::DeleteFile(setup_path); if (!SafeStrCopy(setup_path, setup_path_size, setup_dest_path)) return false; |