Version 23 (modified by Joel, 2 years ago) (diff)

Fixed link to csgettext.

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.

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.

  1. Extract the 7-zip LZMA SDK to a folder (hereafter referred to as %7z%)
  2. Extract 7zLib.zip to %7z%\C\Util and open %7z%\C\Util\7zLib\7zLib.vcproj or %7z%\C\Util\7zLib\7zLib.vcxproj, depending on your version of Visual Studio.
  3. Build the Release version
    • Now, you should end up with a few object files and 7zLib.lib in %7z%\C\Lib\Release
  4. Add %7z% to the Compiler include path and %7z%\C\Lib\Release to the Linker library path

The Boost header files must also be reachable by the compiler.

  1. Extract the Boost library to a folder (%Boost%)
  2. Add %Boost% to the Compiler include path; Eraser does not depend on any Boost library as of now; the headers are sufficient.

Build Eraser

  1. Download the Eraser sources (instructions here: http://sourceforge.net/svn/?group_id=37015); hereafter referred to as %Eraser%
  2. 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.
  3. 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

Build the Installer

Todo: What about those without VS Standard+?

Build the MSI

  1. Create a Folder Merge Modules in the Installer folder
  2. Copy these files from C:\Program Files\Common Files\Merge Modules to the newly created Merge Modules folder.
    • Microsoft_VC(90|100)_CRT_x86_x64.msm
    • Microsoft_VC(90|100)_ATL_x86_x64.msm
    • Microsoft_VC(90|100)_MFC_x86_x64.msm
    • Microsoft_VC(90|100)_CRT_x86.msm
    • Microsoft_VC(90|100)_ATL_x86.msm
    • Microsoft_VC(90|100)_MFC_x86.msm
  3. Open %Eraser%\Installer\Installer.wixproj
  4. If you have Authenticode certificates, be sure to import them to your personal certificate store. The pre-build step for the Installer project will sign all binaries before packaging them into the MSI. Use the Certificates MMC Snap-in to manage your personal certificates.
  5. Change the Target Platform to x86
  6. Build the Installer project
  7. Change the Target Platform to x64
  8. Build the Installer project
    1. At this point %Eraser%\bin\Installer\x86\Release and %Eraser%\bin\Installer\x64\Release should each contain an Eraser.msi
    2. Copy each to %Eraser%\bin\Installer\Eraser (architecture).msi, i.e. %Eraser%\bin\Installer\Eraser (x64).msi
    3. Extract the .NET framework file, copy dotnetfx35.exe to %Eraser%\bin\Installer
    4. 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

  1. Open %Eraser%\Installer\Bootstrapper\Bootstrapper.vcproj
  2. Build the bootstrapper
    • The bootstrapper should be created at %Eraser%\bin\Release\Bootstrapper.exe
  3. 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.
  4. 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
      
  5. Merge the Bootstrapper manifest into the Bootstrapper: the Bootstrapper is built with a manifest that allows the Bootstrapper to be run (without any payload) without administrator permissions. Now that the bootstrapper contains a live setup binary, the Bootstrapper should run with administrator permissions. We thus need to merge the manifest into the binary. Run this command:
    mt /manifest ..\..\Installer\Bootstrapper\Bootstrapper.manifest /outputresource:Installer.exe
    

Congratulations, you have a ready-to-go installer!

Attachments