How to Build Audacity(R) Releases for Microsoft Windows(R)
Copyright 2007-2009, Vaughan Johnson
22 October 2007
Additional authors:
Martyn Shaw (MJS).

========================================================================
This file is currently accurate for Audacity version 1.3.10.
If the advice here is inaccurate or incomplete, please
email audacity-devel@lists.sourceforge.net.
See also "http://audacityteam.org/wiki/index.php?title=Developing_On_Windows".
========================================================================

See "compile.txt" for how to build the executables.

There are currently two types of release builds for Windows, contained 
in the MSVC project configurations Release (for Windows 98/ME) and 
Unicode_Release (for 2000/XP/Vista). These instructions apply for 
either one, but example values are for Unicode_Release. 

1. Remove the old manual and make sure you can rebuild a new one

   a. Make sure you have Python installed and on your PATH.

   b. Delete audacity\help\manual if it exists.

   c. The manual should be built in audacity\help\manual by the 
      main Solution (step 2 below). 

      If you have disabled the 'Help' project during testing you will have to 
      build it separately. 

      If you just want to get the manual, go to 
      audacity\scripts\mw2html_audacity, run wiki2htm and wait for 
      it to complete.


2. Build the executable. 

   a. Make sure you have a current source version from CVS.

   b. Make sure to turn off ASIO support (see compile.txt) if you are 
      creating the installer for public release. 
      We cannot publicly post a build that supports ASIO, for 
      licensing reasons (more detail in compile.txt). 

   c. Check that the following #defines in Audacity.h are up-to-date:
      IS_BETA

   AUDACITY_VERSION

   AUDACITY_RELEASE

   AUDACITY_REVISION

   AUDACITY_SUFFIX
      Especially check the overriding "-alpha-<date>" line.

      (Vaughan believes we have never changed 
      AUDACITY_MODLEVEL, so it can be ignored.)

   d. It's a good idea to not only do a Build > Clean Solution
      beforehand, but to also delete the directory 
      (e.g., audacity\win\unicode_release).

   e. Make sure to build the "locale" project, either 
      separately or as part of Build > Batch Build. You will need
      msgfmt.exe in your PATH for that. Get it from
      http://audacity.sourceforge.net/files/msgfmt.zip


3. Copy other necessities to release build folder.

   a. We are still keeping some of the LADSPA plug-ins in the 
      Audacity installer, even though we are now offering a 
      separate installer that includes all the LADSPA plug-ins 
      built from version 0.4.15. These are the ones we include

      * gverb_1216.dll
      * hard_limiter_1413.dll
      * sc4_1882.dll
      
      Check "http://plugin.org.uk/" for updates. 
      If none, just grab the dlls from a previous release. 
      If updated, build these via the 
      audacity\win\LADSPA_plugins-win project (see 
      audacity\win\LADSPA_plugins-win\readme_LADSPA_plugins-win.txt). 
      
      Once you have these DLL files, put them in the plug-ins 
      folder, e.g., audacity\win\unicode_release\plug-ins.

   b. Make sure you copied to the build folder the appropriate 
      wxWidgets DLLs from "C:\wxWidgets-2.8.10\lib\vc_dll". 
      For details, refer to "Provide access to the wxWidgets DLLs"
      at "MSVC++ STEP 5: Build Audacity" in "compile.txt".  

   c. For 1.3.8, we manually added wxstd.mo files to the "Languages"
      folder in the Audacity build directory. This may be automated 
      in future. Until then, go to
      http://www.audacity.homerow.net/index.php?dir=windows
      and download "locales-2.8.10-msw.zip". Extract the contents 
      into the "Languages" folder.  You want each wxstd.mo file in the
      appropriate language directory/folder.

      Then go to the newly added "gl_ES" and "zh_CN" folders in turn,
      and copy the "wxstd.mo" files from each into the "gl" and zh" folders 
      respectively. Then delete the "gl_ES" and "zh_CN" folders.
      
      (Note that I (MJS) can't make the standard XP extractor do what is
      required here.  I can make 7-zip do it by navigating into
      locales-2.8.10-msw.zip\locales-2.8.10\, selecting all the folders
      then extracting into the Languages folder.)

   d. Also in 1.3.8, it became apparent after release that VC9 Express
      sp1 built Audacity so that it needed pre-sp1 runtimes. To save 
      rebuilding the executable, we replaced the VC90.CRT.manifest 
      supplied by VC9sp1 with one containing the version number of 
      the older runtimes. Until the executable is rebuilt with a flag
      to point Audacity to the VC9sp1 runtimes, do this:       

      1. Go to 
         C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT .
      2. Make a copy of "Microsoft.VC90.CRT.manifest" and call it
         "Microsoft.VC90.CRT.manifest.bak".
      3. In "Microsoft.VC90.CRT.manifest", change version in the 
         <assemblyIdentity> tag from version="9.0.30729.1" to 
         version="9.0.21022.8".
      4. The *.iss scripts (see Step 4 below) will pick up the 
         replacement manifest and DLLs from 
         C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT . 


4. Build the Installer.

   a. Install the latest Inno Setup 
      (http://www.jrsoftware.org/isinfo.php).

   b. Open the appropriate Inno Setup script, 
      audacity\win\audacity.iss for Release or 
      audacity\win\audacity_unicode.iss for Unicode_Release. 
      
   c. Change the version strings as necessary. 
      These are current for Unicode_Release:
   
      * OutputBaseFilename=audacity-win-unicode-1.3.10
      
      * AppName=Audacity 1.3 Beta (Unicode)
         For stable releases, this should just be 
         "Audacity (Unicode)"
      
      * AppVerName=Audacity 1.3.9 (Unicode)
      
      * DefaultDirName={pf}\Audacity 1.3 Beta (Unicode)
         For stable releases, this should just be 
         "Audacity (Unicode)"
   
   d. Compile and test the installer. 
      The result appears in audacity\win\Output.

   e. Check the inbuilt manual to make sure that the 'look'
      is pretty similar to the previous version.  Some changes
      to style sheets may 'break' the mw2html.py script and cause it to
      leave in / miss out some vital bits.

   f. Rename it as necessary, e.g., 
      "audacity-win-unicode-1.3.9rc1.exe".


5. To create the zip version, go to the installed version, 
   e.g., "C:\Program Files\Audacity 1.3 Beta (Unicode)", 
   remove the unins*.* files and the "help" folder, then 
   zip the folder and rename it e.g.,
   "audacity-win-unicode-1.3.9.zip"


=======