| Version 5 (modified by Joel, 4 years ago) (diff) |
|---|
Compiling Eraser from Source
Get the necessary dependencies
Though Eraser (core) is written in C#, several sub-projects are written in C++ (the Shell Extension and Setup bootstrapper) and therefore dependencies do exist.
- 7-zip LZMA SDK (http://7-zip.org/sdk.html). The LZMA SDK is used for the setup bootstrapper.
- Visual Studio Express Editions (http://www.microsoft.com/express/)
- You'll need these to compile Eraser.
- Visual C++ Express Edition
- Visual C# Express Edition
- Of course, Visual Studio Standard and above will be easier. You'll also be able to compile the MSI from within Visual Studio.
- You'll need these to compile Eraser.
- If you wish to produce your own installer
- WiX (http://wix.sourceforge.net/)
- Eraser's Installer is written with a combination of both WiX and C++ for the bootstrapper. The Eraser Installer was written with WiX v3, so grab a nightly build.
- .NET framework, get it from http://www.microsoft.com/downloads/info.aspx?na=22&p=3&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=&u=%2fdownloads%2fdetails.aspx%3fFamilyID%3dab99342f-5d1a-413d-8319-81da479ab0d7%26DisplayLang%3den
- 7-zip, to create the installation bootstrapper archive
- WiX (http://wix.sourceforge.net/)
Proceed to install what must be installed (notably Visual Studio and WiX)
Build the Dependencies
The only thing which must be built as of now is the 7-zip SDK.
- Extract the 7-zip LZMA SDK to a folder (hereafter referred to as %7z%)
- Go to %7z%\C\Archive\7z and open 7z_C.dsw
- If you are using Visual Studio 7 and later you'll be asked to upgrade your project, do so.
- After upgrading, change the Output Directory and Intermediate Directories to ..\..\Lib\$(ConfigurationName)
- Then reset everything under C++\Output Files to their defaults (Inherit from Project Defaults)
- Go to C++\Code Generation and set Runtime Library to Multi-threaded (/MT)
- Build the Release version
- Now, you should end up with a few object files and 7z_C.lib in %7z%\C\Lib\Release
- Add %7z% to the Compiler include path and %7z%\C\Lib\Release to the Linker library path
Build Eraser
- Download the Eraser sources (instructions here: http://sourceforge.net/svn/?group_id=37015); hereafter referred to as %Eraser%
- Open %Eraser%\Eraser.sln
- Users of the Express Editions will be asked whether they want to open it as a C# project or a C++ project, open the C# project first.
- Build Eraser (Release)
- Visual Studio will ask for a Key File. Either you create your own (for private builds) or disable signing altogether.
- If you want to create your own Key File, Go to Eraser Project Settings | Signing. Under Choose a Strong Name Key file, click New...
- When prompted, key in Key File as the name, and uncheck the Protect My Key File with a Password checkbox.
- Go to the Eraser subdirectory and copy Key File.snk to the parent folder, together with the Eraser.sln file
- Do NOT commit your .snk file to the repository
- Binaries should exist in %Eraser%\bin\Release
- Visual Studio will ask for a Key File. Either you create your own (for private builds) or disable signing altogether.
Build the Installer
Todo: What about those without VS Standard+? Todo: What about people who do not have Authenticode pfx's?
Build the MSI
- Open %Eraser%\Installer\Installer.wixproj
- Change the Target Platform to x86
- Build the Installer project
- Change the Target Platform to x64
- Build the Installer project
- At this point %Eraser%\bin\Installer\x86\Release and %Eraser%\bin\Installer\x64\Release should each contain an Eraser.msi
- Copy each to %Eraser%\bin\Installer\Eraser (architecture).msi, i.e. %Eraser%\bin\Installer\Eraser (x64).msi
- Extract the .NET framework file, copy dotnetfx35.exe to %Eraser%\bin\Installer
- Use 7-zip to create an archive, Installer.7z with the two Eraser.msi's and dotnetfx35.exe, maintaining their file names
Build the Bootstrapper
- Open %Eraser%\Installer\Bootstrapper\Bootstrapper.vcproj
- Build the bootstrapper
- The bootstrapper should be created at %Eraser%\bin\Release\Bootstrapper.exe
- Create the setup archive
- Create an archive containing both MSIs created in the previous section, maintaining the names, as well as dotnetfx35.exe. I'll call it Installer.7z.
- Integrate the bootstrapper and the package
- Open a command prompt, cd to %Eraser%\bin\Installer, and run this command:
..\Release\Bootstrapper.exe --integrate Installer.7z --out Installer.exe
- Open a command prompt, cd to %Eraser%\bin\Installer, and run this command:
Congratulations, you have a ready-to-go installer!
