Skip to content

Commit e5f132c

Browse files
committed
Initial open-source commit
0 parents  commit e5f132c

File tree

294 files changed

+56289
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

294 files changed

+56289
-0
lines changed

LICENSE

+674
Large diffs are not rendered by default.

README.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
Windows 7 Boot Updater
2+
======================
3+
4+
This is a program that makes it easy to update the Windows 7 boot animation and text.
5+
6+
The concepts used by this program were originally developed in a thread at [Seven Forums](https://www.sevenforums.com/customization/106861-how-change-boot-animation-windows-7-a.html) by Joakim, marcusj0015, and myself (thaimin).
7+
8+
This source code and resources for the program are released under the GPLv3. This program may be used as-is for commercial purposes and any files modified with it can also be used. However, under the GPLv3, any changes made to the source code or the resources (including the patch descriptions) must be made publicly available if the program or its modified files are distributed in any manner.
9+
10+
Features:
11+
12+
* Modifies the boot animation, colors, text, and background
13+
* Modifies the resume from hibernation screen as well
14+
* Will create the animation from 105 BMP, PNG, GIF, or TIFF images or use a single (non-animated) image
15+
* Does not require any other applications (like ImageX)
16+
* Designed to be idiot-proof by having numerous checks
17+
* Automatically backs-up the modified files
18+
* Does not require test-signing or no-integrity-checks to be enabled
19+
* Works for all versions of Windows 7: any language, any edition, 32-bit or 64-bit, RTM or SP1
20+
* Translated to English, German, Spanish, Russian, Italian, French, Dutch, Hungarian, Hebrew, and Vietnamese
21+
* Works even if your setup has the hidden "System Reserved" partition
22+
* Can be run as a GUI, command-line program, or installer/uninstaller
23+
24+
This program modifies several system files, and while it has been successfully by numerous people, there are circumstances in which it doesn't work or it causes the system to go into an infinite loop of boot repair. See the [troubleshooting](https://www.coderforlife.com/projects/win7boot/#Troubleshooting) guide for common issues, solutions, and how to repair your system if the worst happens.
25+
26+
Source Code
27+
-----------
28+
29+
The source code is broken into 4 separate projects:
30+
31+
* Win7BootUpdater - this is the core of the program, written in C++/CLR. The interface is primarily exposes through the methods of the statis class in Updater.h. The list of all public interfaces are given in AllPublic.cpp. Can be compiled as a static library or a DLL.
32+
* Win7BootUpdater.CUI - the command line interface program. Written in C#.
33+
* Win7BootUpdater.GUI - the GUI program. Written in C#.
34+
* Win7BootUpdater.Installer - the installer-based version of the program. Written in C#.
35+
36+
The src/Resources folder contains all of the resources used by the programs. It also includes a few tools required for compiling the resources:
37+
38+
* patch-compiler.exe - compiles the XML files describing the patching of system files into binary files. Source for this program is in tools/patch-compiler. This program uses the Ionic.Zlib.dll library to perform compression. That library is not needed for the final program.
39+
* xml-compact.exe - compacts XML files to reduce their size. Source available at [github.com/coderforlife/c4l-utils/tree/master/xml-compact](https://github.com/coderforlife/c4l-utils/tree/master/xml-compact).
40+
* gzip.bat and zip-all.bat - use 7-zip (must be installed on the system) to gzip files or add all txt files to a zip file
41+
42+
Compilation
43+
-----------
44+
45+
It is quite tricky to compile programs that are a mix of C, C++, C++/CLR, and C#. The batch files in the src folder are there to assist in compilation of the program. There are numerous prerequites for compiling though:
46+
47+
* [7-zip](https://www.7-zip.org/download.html) (used to compress various resources)
48+
* [MS Visual Studio 2008 SP1 C++ Express](https://download.microsoft.com/download/E/8/E/E8EEB394-7F42-4963-A2D8-29559B738298/VS2008ExpressWithSP1ENUX1504728.iso) (for various tools)
49+
* [Windows 7 SDK and .NET 4 for x86](https://www.microsoft.com/en-us/Download/8442)
50+
* [Windows AIK for Windows 7 (v3.0)](https://www.microsoft.com/en-us/download/5753)
51+
52+
Testing
53+
-------
54+
55+
The tests folder contains the files used for testing along with batch files for automating some of the tests using a VirtualBox virtual machine. The tests are not fully automated, but do get all of the long tasks done.

src/Compile/all.bat

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
:: Compile all resources and programs
2+
:: Must have many things set before using this file:
3+
:: OUT - the output directory
4+
:: TARGET - the compilation target (e.g. x86), given to vcvarsall.bat
5+
:: TARGETX - the compilation target (e.g. x86), used in VC tool command lines
6+
:: TARGET_FULL - the full name of the compilation target (e.g. i386)
7+
:: TOOLCHAIN - toolchain version (vs90 or vs100)
8+
:: VS90COMNTOOLS or VS100COMNTOOLS - location of the toolchain
9+
:: COMPILE_... - if set to 1, that option is compiled
10+
:: where ... is: RESOURCES, CORE, INSTALLER, GUI, or CMD
11+
12+
@call Compile\settings.bat
13+
14+
@set ORIG_PATH="%PATH%"
15+
@set INCLUDE=""
16+
@set LIB=""
17+
@set LIBPATH=""
18+
19+
@if "%TOOLCHAIN%"=="vs90" (
20+
@call "%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat" %TARGET%
21+
@set CL_TC=
22+
) else (
23+
@call "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat" %TARGET%
24+
@set CL_TC=/GL
25+
)
26+
27+
@echo on
28+
29+
30+
@if "%DEBUGGING%"=="ON" (
31+
@set OUT=%OUT%-debug
32+
@set DEBUG=-debug
33+
@set RC_DBG=/d _DEBUG
34+
@set CL_DBG=/Zi /MDd /D _DEBUG /Fd..\%OUT%-debug\
35+
@set LNK_DBG=/DEBUG
36+
@set CSC_DBG=/debug /d:DEBUG
37+
) else (
38+
@set DEBUG=
39+
@set RC_DBG=/d NDEBUG
40+
@set CL_DBG=/MD /D NDEBUG
41+
@set LNK_DBG=/OPT:REF /OPT:ICF
42+
@set CSC_DBG=/o+
43+
)
44+
:: /DEFAULTLIB:msvcmrtd.lib
45+
:: /DEFAULTLIB:msvcmrt.lib
46+
47+
@mkdir %OUT% >nul 2>&1
48+
49+
@set W7BU=%OUT%\Win7BootUpdater
50+
51+
@set ORIG_PROMPT=%PROMPT%
52+
@set PROMPT=$G
53+
54+
set RC=%RC_DBG% /d GUI /d %TARGETX% /d %TOOLCHAIN%
55+
set CL=/nologo %CL_DBG% %CL_TC% /W4 /wd4201 /wd4480 /O2 /GS /EHa /MP /D _UNICODE /D UNICODE /D INTEGRATED /Fo..\%OUT%\
56+
set INCLUDE=%EXTRA_INCLUDES%;%INCLUDE%
57+
set LINK=/nologo %LNK_DBG% /LTCG /CLRIMAGETYPE:IJW /MANIFEST:NO /MACHINE:%TARGETX%
58+
set LIB=%EXTRA_LIBS%;%LIB%
59+
set CSC=/nologo %CSC_DBG% /w:4 /d:INTEGRATED /target:module
60+
::/platform:%TARGETX%
61+
62+
@IF "%COMPILE_RESOURCES%" NEQ "1" GOTO :AFTER_RESOURCES
63+
@echo.
64+
@echo *************** Resources ***********************
65+
@call Compile\resources.bat
66+
@IF %ERRORLEVEL% NEQ 0 GOTO :END
67+
68+
:AFTER_RESOURCES
69+
@IF "%COMPILE_CORE%" NEQ "1" GOTO :AFTER_CORE
70+
@echo.
71+
@echo *************** Core ****************************
72+
@call Compile\core.bat
73+
@IF %ERRORLEVEL% NEQ 0 GOTO :END
74+
75+
:AFTER_CORE
76+
@IF "%COMPILE_INSTALLER%" NEQ "1" GOTO :AFTER_INSTALLER
77+
@echo.
78+
@echo *************** Installer ***********************
79+
@call Compile\installer.bat
80+
@IF %ERRORLEVEL% NEQ 0 GOTO :END
81+
82+
:AFTER_INSTALLER
83+
@IF "%COMPILE_GUI%" NEQ "1" GOTO :AFTER_GUI
84+
@echo.
85+
@echo *************** GUI *****************************
86+
@call Compile\gui.bat
87+
@IF %ERRORLEVEL% NEQ 0 GOTO :END
88+
89+
:AFTER_GUI
90+
@IF "%COMPILE_CMD%" NEQ "1" GOTO :AFTER_CMD
91+
@echo.
92+
@echo *************** CMD *****************************
93+
@call Compile\cmd.bat
94+
@IF %ERRORLEVEL% NEQ 0 GOTO :END
95+
96+
:AFTER_CMD
97+
@echo.
98+
@echo Compiled Successfully!
99+
100+
::@echo.
101+
::@echo *************** Cleanup *************************
102+
::@call Compile\cleanup.bat
103+
::@IF %ERRORLEVEL% NEQ 0 GOTO :END
104+
105+
:END
106+
@echo.
107+
@set PROMPT=%ORIG_PROMPT%
108+
@set PATH="%ORIG_PATH%"

src/Compile/cleanup.bat

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
:: Remove intermediate compilation files
2+
3+
@pushd %OUT%
4+
5+
del /F /Q *.obj *.netmodule *.resources *.res
6+
7+
@popd

src/Compile/cmd.bat

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
:: Compile the command line program
2+
3+
@pushd Win7BootUpdater.CUI
4+
5+
csc %CSC% /addmodule:..\%OUT%\AllPublic.obj /out:..\%W7BU%.CUI.netmodule /recurse:*.cs
6+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
7+
8+
cl /c /clr /LN /FU..\%W7BU%.CUI.netmodule main.cpp
9+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
10+
11+
@popd
12+
13+
link /FIXED /OUT:%W7BU%Cmd.exe /SUBSYSTEM:CONSOLE,6.0 ^
14+
%OUT%\cmd.res /ASSEMBLYRESOURCE:%W7BU%.resources,Win7BootUpdater.resources,PRIVATE ^
15+
%OUT%\*.obj %W7BU%.CUI.netmodule
16+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
17+
18+
@if NOT "%TARGET%"=="x86" GOTO end
19+
CorFlags /nologo %W7BU%Cmd.exe /32BIT+
20+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
21+
22+
:end

src/Compile/core.bat

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
:: Compile the core library
2+
3+
@pushd Win7BootUpdater
4+
5+
@set CL_NATIVE=/c /FI"stdafx-native.h"
6+
@set CL_MIXED=/c /clr /LN /FI"stdafx-mixed.h"
7+
@set CL_PURE=/c /clr:safe /LN /GL /FI"stdafx-pure.h"
8+
9+
@set PURE=%PURE% AllPublic.cpp
10+
11+
cl /c /TC /wd4100 /wd4127 /wd4131 /wd4244 %LIBPNG%
12+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
13+
14+
cl %CL_NATIVE% %NATIVE%
15+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
16+
17+
cl %CL_MIXED% %MIXED%
18+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
19+
20+
cl %CL_PURE% %PURE%
21+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
22+
23+
@popd

src/Compile/gui.bat

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
:: Compile the GUI program
2+
3+
@pushd Win7BootUpdater.GUI
4+
5+
csc %CSC% /addmodule:..\%OUT%\AllPublic.obj /out:..\%W7BU%.GUI.netmodule /recurse:*.cs
6+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
7+
8+
cl /c /clr /LN /FU..\%W7BU%.GUI.netmodule main.cpp
9+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
10+
11+
@popd
12+
13+
link /FIXED /OUT:%W7BU%.exe /SUBSYSTEM:WINDOWS,6.0 ^
14+
%OUT%\gui.res /ASSEMBLYRESOURCE:%W7BU%.resources,Win7BootUpdater.resources,PRIVATE /ASSEMBLYRESOURCE:%W7BU%.GUI.resources,Win7BootUpdater.GUI.resources,PRIVATE ^
15+
%OUT%\*.obj %W7BU%.GUI.netmodule
16+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
17+
18+
@if NOT "%TARGET%"=="x86" GOTO end
19+
CorFlags /nologo %W7BU%.exe /32BIT+
20+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
21+
22+
:end

src/Compile/installer.bat

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
:: Compile the installer program
2+
3+
@pushd Win7BootUpdater.Installer
4+
5+
csc %CSC% /addmodule:..\%OUT%\AllPublic.obj /out:..\%W7BU%.Installer.netmodule /recurse:*.cs
6+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
7+
8+
cl /c /clr /LN /FU..\%W7BU%.Installer.netmodule main.cpp
9+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
10+
11+
@popd
12+
13+
link /FIXED /OUT:%OUT%\installer.exe /SUBSYSTEM:WINDOWS,6.1 ^
14+
%OUT%\installer.res /ASSEMBLYRESOURCE:%W7BU%.resources,Win7BootUpdater.resources,PRIVATE /ASSEMBLYRESOURCE:%W7BU%.Installer.resources,Win7BootUpdater.Installer.resources,PRIVATE ^
15+
%OUT%\*.obj %W7BU%.Installer.netmodule
16+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
17+
18+
@if NOT "%TARGET%"=="x86" GOTO end
19+
CorFlags /nologo %OUT%\installer.exe /32BIT+
20+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
21+
22+
:end
23+
24+
@echo.
25+
@echo *************** Installer Resources *************
26+
27+
@pushd Resources
28+
29+
copy /B /Y ..\%OUT%\installer.exe .
30+
31+
call gzip installer.exe
32+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
33+
34+
resgen Win7BootUpdater.GUI.resx ..\%W7BU%.GUI.resources
35+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
36+
37+
@popd

src/Compile/resources.bat

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
:: Prepare and compile all of the resources
2+
3+
@pushd Resources
4+
5+
xml-compact bs7.xsd bs7.bin >NUL
6+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
7+
8+
@set MANIFEST=%TARGETX%-%TOOLCHAIN%%DEBUG%.manifest
9+
xml-compact %MANIFEST% %MANIFEST%.bin >NUL
10+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
11+
12+
call gzip bs7.bin
13+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
14+
15+
::call gzip messages.txt
16+
::@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
17+
18+
@pushd messages
19+
@call zip-all
20+
@popd
21+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
22+
23+
call gzip eula.txt
24+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
25+
26+
patch-compiler bootmgr.xml
27+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
28+
29+
patch-compiler winload.xml
30+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
31+
32+
patch-compiler winresume.xml
33+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
34+
35+
rc %RC% /d GUI /fo ..\%OUT%\gui.res app.rc
36+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
37+
38+
rc %RC% /d CMD /fo ..\%OUT%\cmd.res app.rc
39+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
40+
41+
resgen Win7BootUpdater.resx ..\%W7BU%.resources
42+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
43+
44+
@IF "%COMPILE_INSTALLER%" NEQ "1" GOTO :NO_INSTALLER
45+
46+
rc %RC% /d Installer /fo ..\%OUT%\installer.res installer.rc
47+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
48+
49+
resgen Win7BootUpdater.Installer.resx ..\%W7BU%.Installer.resources
50+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
51+
52+
@GOTO :DONE
53+
54+
:NO_INSTALLER
55+
resgen Win7BootUpdater.GUI.resx ..\%W7BU%.GUI.resources
56+
@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
57+
58+
:DONE
59+
@popd

src/Compile/settings.bat

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
:: The settings for compiling the programs
2+
3+
:: Set to ON to compile with debug symbols
4+
@set DEBUGGING=OFF
5+
6+
@set WIMGAPI=C:\Program Files\Windows AIK\SDKs\WIMGAPI\%TARGET%
7+
:: Only need this for ntdll.h, include it instead in the source directory since the WinDDK is huge
8+
::@set WINDDK=C:\WinDDK\7600.16385.1\lib\wlh\%TARGET_FULL%
9+
10+
::@set EXTRA_INCLUDES=%WIMGAPI%;%WINDDK%
11+
::@set EXTRA_LIBS=%WIMGAPI%;%WINDDK%
12+
@set EXTRA_INCLUDES=%WIMGAPI%
13+
@set EXTRA_LIBS=%WIMGAPI%
14+
15+
@set ZLIB=libpng\adler32.c libpng\compress.c libpng\crc32.c libpng\deflate.c libpng\trees.c libpng\zutil.c
16+
@set LIBPNG=libpng\png.c libpng\pngerror.c libpng\pngget.c libpng\pngmem.c libpng\pngset.c libpng\pngwio.c libpng\pngwrite.c libpng\pngwtran.c libpng\pngwutil.c
17+
@set LIBPNG=%LIBPNG% %ZLIB%
18+
19+
@set NATIVE=bmzip.cpp Bytes.cpp Files.cpp FileSecurity.cpp PEFile.cpp PEFileResources.cpp WIM.cpp Trace.cpp
20+
@set MIXED=Bootmgr.cpp Bcd.cpp Bootres.cpp FileUpdater.cpp MessageTable.cpp Patch.cpp PDB.cpp PEFiles.cpp PngConverter.cpp UI-native.cpp Updater.cpp Utilities.cpp WinXXX.cpp Zip.cpp
21+
@set PURE=Animation.cpp BootSkin.cpp MultipartFile.cpp Resources.cpp UI.cpp Winload.cpp Winresume.cpp WMI.cpp

src/README.txt

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
To be able to run the compile-x86-net2 command the following need to be installed:
2+
* 7-zip (to be able to compress various resources)
3+
* MS Visual Studio 2008 SP1 C++ Express (for various tools)
4+
* Windows SDK v7.0 and .NET 3.5 SP1
5+
* Windows AIK for Windows 7 (v3.0)
6+
* Microsoft .NET 4.0 Framework
7+
8+
Possibly, but I doubt it:
9+
* MS Visual C++ 2015 Redis x86
10+
* MS Visual C++ 2010 Redis x86

src/Resources/Ionic.Zlib.dll

96 KB
Binary file not shown.

0 commit comments

Comments
 (0)