Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / installer / test / alternate_version_generator.h
blobb75b381fa23a0169b971bc26be87e798be411b52
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.
7 #ifndef CHROME_INSTALLER_TEST_ALTERNATE_VERSION_GENERATOR_H_
8 #define CHROME_INSTALLER_TEST_ALTERNATE_VERSION_GENERATOR_H_
10 #include <string>
12 namespace base {
13 class FilePath;
14 class Version;
17 namespace upgrade_test {
19 enum Direction {
20 PREVIOUS_VERSION,
21 NEXT_VERSION
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);
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);
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);
52 } // namespace upgrade_test
54 #endif // CHROME_INSTALLER_TEST_ALTERNATE_VERSION_GENERATOR_H_