1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 // 5 // This file exposes the public interface to the mini_installer re-versioner. 6 7 #ifndef CHROME_INSTALLER_TEST_ALTERNATE_VERSION_GENERATOR_H_ 8 #define CHROME_INSTALLER_TEST_ALTERNATE_VERSION_GENERATOR_H_ 9 10 #include <string> 11 12 namespace base { 13 class FilePath; 14 class Version; 15 } 16 17 namespace upgrade_test { 18 19 enum Direction { 20 PREVIOUS_VERSION, 21 NEXT_VERSION 22 }; 23 24 // Generates an alternate mini_installer.exe using the one indicated by 25 // |original_installer_path|, giving the new one a lower or higher version than 26 // the original and placing it in |target_path|. Any previous file at 27 // |target_path| is clobbered. Returns true on success. |original_version| and 28 // |new_version|, when non-NULL, are given the original and new version numbers 29 // on success. 30 bool GenerateAlternateVersion(const base::FilePath& original_installer_path, 31 const base::FilePath& target_path, 32 Direction direction, 33 std::wstring* original_version, 34 std::wstring* new_version); 35 36 // Given a path to a PEImage in |original_file|, copy that file to 37 // |target_file|, modifying the version of the copy according to |direction|. 38 // Any previous file at |target_file| is clobbered. Returns true on success. 39 // Note that |target_file| may still be mutated on failure. 40 bool GenerateAlternatePEFileVersion(const base::FilePath& original_file, 41 const base::FilePath& target_file, 42 Direction direction); 43 44 // Given a path to a PEImage in |original_file|, copy that file to 45 // |target_file|, modifying the version of the copy according to |version|. 46 // Any previous file at |target_file| is clobbered. Returns true on success. 47 // Note that |target_file| may still be mutated on failure. 48 bool GenerateSpecificPEFileVersion(const base::FilePath& original_file, 49 const base::FilePath& target_file, 50 const base::Version& version); 51 52 } // namespace upgrade_test 53 54 #endif // CHROME_INSTALLER_TEST_ALTERNATE_VERSION_GENERATOR_H_ 55