| Version 2 (modified by Joel, 5 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.
- 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.
- If you wish to produce your own installer
- You'll need the .NET framework, get it here: 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
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.
- Binaries should exist in %Eraser%\bin\Release
Build the Installer
Todo: What about those without VS Standard+?
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
- 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!
