Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // mini_installer.exe is the first exe that is run when chrome is being | 5 // mini_installer.exe is the first exe that is run when chrome is being |
| 6 // installed or upgraded. It is designed to be extremely small (~5KB with no | 6 // installed or upgraded. It is designed to be extremely small (~5KB with no |
| 7 // extra resources linked) and it has two main jobs: | 7 // extra resources linked) and it has two main jobs: |
| 8 // 1) unpack the resources (possibly decompressing some) | 8 // 1) unpack the resources (possibly decompressing some) |
| 9 // 2) run the real installer (setup.exe) with appropiate flags. | 9 // 2) run the real installer (setup.exe) with appropiate flags. |
| 10 // | 10 // |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 // are forced to manually link against it. It comes in the form of two | 21 // are forced to manually link against it. It comes in the form of two |
| 22 // object files that exist in $(VCInstallDir)\crt\src which are memset.obj and | 22 // object files that exist in $(VCInstallDir)\crt\src which are memset.obj and |
| 23 // P4_memset.obj. These two object files rely on the existence of a static | 23 // P4_memset.obj. These two object files rely on the existence of a static |
| 24 // variable named __sse2_available which indicates the presence of intel sse2 | 24 // variable named __sse2_available which indicates the presence of intel sse2 |
| 25 // extensions. We define it to false which causes a slower but safe code for | 25 // extensions. We define it to false which causes a slower but safe code for |
| 26 // memcpy and memset intrinsics. | 26 // memcpy and memset intrinsics. |
| 27 | 27 |
| 28 // having the linker merge the sections is saving us ~500 bytes. | 28 // having the linker merge the sections is saving us ~500 bytes. |
| 29 #pragma comment(linker, "/MERGE:.rdata=.text") | 29 #pragma comment(linker, "/MERGE:.rdata=.text") |
| 30 | 30 |
| 31 #ifdef COMPILER_MSVCEXPRESS | |
| 32 #include <intrin.h> // __stosb for memset | |
|
Mark Mentovai
2011/03/16 16:25:20
Two spaces before the //, one after.
M-A Ruel
2011/03/16 17:48:55
Just include it, no need for #ifdef.
RN
2011/03/17 06:33:25
Done and Done.
| |
| 33 #endif | |
| 31 #include <windows.h> | 34 #include <windows.h> |
| 32 #include <setupapi.h> | 35 #include <setupapi.h> |
| 33 #include <shellapi.h> | 36 #include <shellapi.h> |
| 34 #include <shlwapi.h> | 37 #include <shlwapi.h> |
| 35 | 38 |
| 36 #include "chrome/installer/mini_installer/appid.h" | 39 #include "chrome/installer/mini_installer/appid.h" |
| 37 #include "chrome/installer/mini_installer/mini_installer.h" | 40 #include "chrome/installer/mini_installer/mini_installer.h" |
| 38 #include "chrome/installer/mini_installer/pe_resource.h" | 41 #include "chrome/installer/mini_installer/pe_resource.h" |
| 39 | 42 |
| 40 // Required linker symbol. See remarks above. | 43 // Required linker symbol. See remarks above. |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 697 return exit_code; | 700 return exit_code; |
| 698 } | 701 } |
| 699 | 702 |
| 700 } // namespace mini_installer | 703 } // namespace mini_installer |
| 701 | 704 |
| 702 | 705 |
| 703 int MainEntryPoint() { | 706 int MainEntryPoint() { |
| 704 int result = mini_installer::WMain(::GetModuleHandle(NULL)); | 707 int result = mini_installer::WMain(::GetModuleHandle(NULL)); |
| 705 ::ExitProcess(result); | 708 ::ExitProcess(result); |
| 706 } | 709 } |
| 710 | |
| 711 // VC Express editions don't come with the memset CRT obj file | |
| 712 #ifdef COMPILER_MSVCEXPRESS | |
| 713 extern "C" { | |
|
Mark Mentovai
2011/03/16 16:25:20
Don’t indent this line at all.
RN
2011/03/17 06:33:25
Done.
| |
| 714 #pragma function(memset) | |
|
Mark Mentovai
2011/03/16 16:25:20
Never indent C preprocessor directives.
RN
2011/03/17 06:33:25
Done.
| |
| 715 void* memset(void *dest, int ci, size_t count) { | |
|
Mark Mentovai
2011/03/16 16:25:20
The indentation in here is wrong, too.
RN
2011/03/17 06:33:25
Think I fixed this.
| |
| 716 __stosb((unsigned char*)dest, (unsigned char)ci, count); | |
| 717 return dest; | |
| 718 } | |
| 719 } | |
| 720 #endif | |
| 721 | |
|
Mark Mentovai
2011/03/16 16:25:20
Get rid of the blank line at EOF.
RN
2011/03/17 06:33:25
Done.
| |
| OLD | NEW |