]> granicus.if.org Git - imagemagick/blob - www/advanced-windows-installation.html
Added checks for exceptions.
[imagemagick] / www / advanced-windows-installation.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en" xsi:schemaLocation="http://www.w3.org/1999/xhtml                           http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd">
3 <head>
4   <meta http-equiv="content-type" content="text/html; charset=UTF-8"></meta>
5   <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4"></meta>
6   <title>ImageMagick: Advanced Windows Source Installation</title>
7   <meta http-equiv="content-language" content="en-US"></meta>
8   <meta http-equiv="content-type" content="text/html; charset=utf-8"></meta>
9   <meta http-equiv="reply-to" content="magick-users@imagemagick.org"></meta>
10   <meta name="application-name" content="ImageMagick"></meta>
11   <meta name="description" content="Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats.  In addition, resize, rotate, shear, distort or transform images automagically."></meta>
12   <meta name="application-url" content="http://www.imagemagick.org"></meta>
13   <meta name="generator" content="PHP"></meta>
14   <meta name="keywords" content="advanced, windows, source, installation, ImageMagick, PerlMagick, image processing, OpenMP, software development library, image, photo, software, Magick++, MagickWand"></meta>
15   <meta name="rating" content="GENERAL"></meta>
16   <meta name="robots" content="INDEX, FOLLOW"></meta>
17   <meta name="generator" content="ImageMagick Studio LLC"></meta>
18   <meta name="author" content="ImageMagick Studio LLC"></meta>
19   <meta name="revisit-after" content="2 DAYS"></meta>
20   <meta name="resource-type" content="document"></meta>
21   <meta name="copyright" content="Copyright (c) 1999-2012 ImageMagick Studio LLC"></meta>
22   <meta name="distribution" content="Global"></meta>
23   <link rel="icon" href="../images/wand.png"></link>
24   <link rel="shortcut icon" href="../images/wand.ico" type="images/x-icon"></link>
25   <link rel="canonical" href="http://www.imagemagick.org"></link>
26   <link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf"></link>
27
28   <!-- Add jQuery library -->
29   <script type="text/javascript" src="http://localhost/ajax/libs/jquery/1.7/jquery.min.js"></script>
30   
31   <!-- Add mousewheel plugin (this is optional) -->
32   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/lib/jquery.mousewheel-3.0.6.pack.js"></script>
33   
34   <!-- Add fancyBox -->
35   <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/jquery.fancybox.css?v=2.0.6" type="text/css" media="screen"></link>
36   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/jquery.fancybox.pack.js?v=2.0.6"></script>
37   
38   <!-- Optionally add helpers - button, thumbnail and/or media -->
39   <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.2" type="text/css" media="screen"></link>
40   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.2"></script>
41   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.0"></script>
42   
43   <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.css?v=2.0.6" type="text/css" media="screen"></link>
44   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.js?v=2.0.6"></script>
45   
46   <script type="text/javascript">
47         $(document).ready(function() {
48                 $(".fancybox").fancybox();
49         });
50   </script>
51
52   <!-- ImageMagick style -->
53   <style type="text/css" media="all">
54     @import url("../www/magick.css");
55   </style>
56 </head>
57
58 <body id="www-imagemagick-org">
59
60
61
62 <div class="titlebar">
63 <div style="margin: 17px auto; float: left;">
64   <script type="text/javascript">
65   <!--
66     google_ad_client = "pub-3129977114552745";
67     google_ad_slot = "5439289906";
68     google_ad_width = 728;
69     google_ad_height = 90;
70   //-->
71   </script>
72   
73 </div>
74 <a href="../discourse-server">
75   <img src="../images/logo.jpg" alt="ImageMagick Logo" style="width: 123px; height: 118px; border: 0px; float: right;"></img></a>
76 <a href="http://www.imagemagick.org/ImageMagick-7.0.0/index.html">
77   <img src="../images/sprite.jpg" alt="ImageMagick Sprite" style="width: 114px; height: 118px; border: 0px; float: right;"></img></a>
78 </div>
79
80 <div class="westbar">
81
82 <div class="menu">
83   <a title="About ImageMagick" href="http://www.imagemagick.org/ImageMagick-7.0.0/index.html">About ImageMagick</a>
84 </div>
85 <div class="menu">
86   <a title="Binary Releases" href="binary-releases.html">Binary Releases</a>
87 </div>
88 <div class="sub">
89     <a title="Binary Release: Unix" href="binary-releases.html#unix">Unix</a>
90 </div>
91 <div class="sub">
92     <a title="Binary Release: MacOS X" href="binary-releases.html#macosx">Mac OS X</a>
93 </div>
94 <div class="sub">
95     <a title="Binary Release: iOS" href="binary-releases.html#iOS">iOS</a>
96 </div>
97 <div class="sub">
98     <a title="Binary Release: Windows" href="binary-releases.html#windows">Windows</a>
99 </div>
100 <div class="sep"></div>
101 <div class="menu">
102   <a title="Command-line Tools" href="command-line-tools.html">Command-line Tools</a>
103 </div>
104 <div class="sub">
105     <a title="Command-line Tools: Processing" href="command-line-processing.html">Processing</a>
106 </div>
107 <div class="sub">
108     <a title="Command-line Tools: Options" href="command-line-options.html">Options</a>
109 </div>
110 <div class="sub">
111     <a title="Command-line Tools: Usage" href="http://www.imagemagick.org/Usage/">Usage</a>
112 </div>
113 <div class="menu">
114   <a title="Program Interfaces" href="api.html">Program Interfaces</a>
115 </div>
116 <div class="sub">
117     <a title="Program Interface: MagickWand" href="magick-wand.html">MagickWand</a>
118 </div>
119 <div class="sub">
120     <a title="Program Interface: MagickCore" href="magick-core.html">MagickCore</a>
121 </div>
122 <div class="sub">
123     <a title="Program Interface: PerlMagick" href="perl-magick.html">PerlMagick</a>
124 </div>
125 <div class="sub">
126     <a title="Program Interface: Magick++" href="magick++.html">Magick++</a>
127 </div>
128 <div class="sep"></div>
129 <div class="menu">
130    <a title="Install from Source" href="install-source.html">Install from Source</a>
131 </div>
132 <div class="sub">
133     <a title="Install from Source: Unix" href="install-source.html#unix">Unix</a>
134 </div>
135 <div class="sub">
136     <a title="Install from Source: Windows" href="install-source.html#windows">Windows</a>
137  </div>
138 <div class="menu">
139   <a title="Resources" href="resources.html">Resources</a>
140 </div>
141 <div class="menu">
142   <a title="Architecture" href="architecture.html">Architecture</a>
143 </div>
144 <div class="menu">
145   <a title="Download" href="download.html">Download</a>
146 </div>
147 <div class="sep"></div>
148 <div class="menu">
149   <a title="Search" href="search.html">Search</a>
150 </div>
151 <div class="sep"></div>
152 <div class="menu">
153   <a title="Site Map" href="sitemap.html">Site Map</a>
154 </div>
155 <div class="sub">
156   <a title="Site Map: Links" href="links.html">Links</a>
157 </div>
158 <div class="sep"></div>
159 </div>
160
161 <div class="eastbar">
162   
163   <div> <a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="http://www.imagemagick.org/"></a></div>
164   <noscript>
165     <a href="http://flattr.com/thing/947300/Convert-Edit-And-Compose-Images" target="_blank">
166     <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" width="93" height="20" border="0"></img></a>
167   </noscript>
168     
169     
170 </div>
171
172 <div class="main">
173
174
175 <h1>ImageMagick Advanced Windows Installation</h1>
176 <p class="navigation-index">[<a href="advanced-windows-installation.html#download">Download &amp; Unpack</a> • <a href="advanced-windows-installation.html#configure">Configure</a>  • <a href="advanced-windows-installation.html#build">Build</a> • <a href="advanced-windows-installation.html#install">Install</a> • <a href="advanced-windows-installation.html#binary">Create a Self-installing Binary Distribution</a> • <a href="advanced-windows-installation.html#problems">Dealing with Unexpected Problems</a> • <a href="advanced-windows-installation.html#project">Building Your Custom Project</a>]</p>
177
178 <div class="doc-section">
179 <p>It's possible you don't want to concern yourself with advanced installation under Windows.  If so, you also have the option of installing a self-installing <a href="binary-releases.html#windows">binary release</a> or if you still want to install from source without all the fuss see the simple <a href="install-source.html#windows">Install From Source</a> instructions.  However, if you want to customize the configuration and installation of ImageMagick under Windows, lets begin.</p>
180 </div>
181
182 <h2><a id="download"></a>Download &amp; Unpack</h2>
183 <div class="doc-section">
184
185 <p>Building ImageMagick source for Windows requires a modern version of Microsoft Visual Studio IDE.  Users have reported success with the Borland C++ compiler as well.  If you don't have a compiler you can still install a self-installing <a href="binary-releases.html#windows">binary release</a>.</p>
186
187 <p>Download <a href="http://www.imagemagick.org/download/windows/ImageMagick-windows.zip">ImageMagick-windows.zip</a> from <a href="http://www.imagemagick.org/download/windows">ftp.imagemagick.org</a> or its <a href="download.html">mirrors</a> and verify the distribution against its <a href="http://www.imagemagick.org/download/windows/digest.rdf">message digest</a>.</p>
188
189 <p>You can unpack the distribution with <a href="http://www.winzip.com">WinZip</a> or type the following from any Command Prompt window:</p>
190
191 <p class="crt"><span class="crtprompt"> $magick&gt; </span><span class="crtin">unzip ImageMagick-windows.zip</span></p>
192 <p>Now that you have the ImageMagick Windows source distribution unpacked, let's configure it.</p>
193
194 </div>
195
196 <h2><a id="configure"></a>Configure</h2>
197 <div class="doc-section">
198
199 <p>These instructions are specific to building ImageMagick with the <a href="http://msdn.microsoft.com/vstudio/">Visual Studio</a> under Windows XP, Win2K, or Windows 98.  ImageMagick does not include any workspace (DSW) or project files (DSP) except for those included with third party libraries. Instead, there is a <code>configure</code> program that must be built and run which creates the Visual Studio workspaces for ImageMagick.  The Visual Studio system provides four different types of <em>runtime</em> environments that must match across all application, library, and dynamic-library (DLL) code that is built. The <code>configure</code> program creates a set of build files that are consistent for a specific runtime selection listed here:</p>
200
201 <ol>
202   <li>Dynamic Multi-threaded DLL runtimes (VisualDynamicMT).</li>
203   <li>Static Single-threaded runtimes (VisualStaticST).</li>
204         <li>Static Multi-threaded runtimes (VisualStaticMT).</li>
205         <li>Static Multi-threaded DLL runtimes (VisualStaticMTDLL).</li>
206 </ol>
207
208 <p>In addition to these runtimes, the VisualMagick build environment allows you to select whether to include the X11 libraries in the build or not.  X11 DLLs and headers are provided with the VisualMagick build environment.  Most Windows users are probably not interested in using X11, so you might prefer to build without X11 support.  Since the <code>animate</code>, <code>display</code>, and <code>import</code> program depends on the X11 delegate libraries, these programs will no work if you choose not to include X11 support.</p>
209
210 <p>This leads to five different possible build options. The default binary distribution is built using the Dynamic Multi-threaded DLL (VisualDynamicMT) option with the X11 libraries included.  This results in an X11 compatible build using all DLL's for everything and multi-threaded support (the only option for DLL's).</p>
211
212 <p>To create a workspace for your requirements, simply go to the <code>VisualMagick\configure</code> folder and open the <code>configure.dsw</code> workspace (for Visual Studio 6) or <code>configure.sln</code> (for Visual Studio 7 or 8). Set the build configuration to <em>Release</em>.</p>
213
214 <p>Build and execute the configure program and follow the on-screen instructions.  You should not change any of the defaults unless you have a specific reason to do so.</p>
215
216 <p>The configure program has a button entitled:</p>
217
218 <p class="text">
219   Edit "magick_config.h"
220 </p>
221
222 <p>Click on this button to bring up <code>magick-config.h</code> in Windows Notepad.  Review and optionally change any preprocessor defines in ImageMagick's <code>magick_config.h</code> file to suit your needs.  This file is copied to <code>magick\magick_config.h</code>.  You may safely open <code>magick\magick_config.h</code>, modify it, and recompile without re-running the configure program. In fact, using Notepad to edit the copied file may be preferable since it preserves the original <code>magick_config.h</code> file.</p>
223
224 <p>Key user defines in <code>magick_config.h</code> include:</p>
225
226 <dl class="doc">
227 <dt> MAGICKCORE_QUANTUM_DEPTH (default 16)</dt>
228   <dd>Specify the depth of the pixel component depth (8, 16, or 32).  A value of 8 uses half the memory than 16 and may run 30% faster, but provides 256 times less color resolution than a value of 16.  We recommend a quantum depth of 16 because 16-bit images are becoming more prevalent on the Internet.</dd>
229 <dt>MAGICKCORE_INSTALLED_SUPPORT (default undefined)</dt>
230   <dd>Define to build a ImageMagick which uses registry settings or embedded paths to locate installed components (coder modules and configuration files). The default is to look for all files in the same directory as the executable.  You will wand to define this value if you intend on <a href="advanced-windows-installation.html#install">installing</a> ImageMagick on your system.</dd>
231 <dt>ProvideDllMain (default defined)</dt>
232   <dd>Define to include a DllMain() function ensures that the ImageMagick DLL is properly initialized without participation from dependent applications. This avoids the requirement to invoke InitializeMagick() from dependent applications is only useful for DLL builds.</dd>
233 </dl>
234
235 <p>ImageMagick is now configured and ready to build.</p>
236
237 <p>The default build is WIN32.  For 64-bit, open a newly created solution and enter Configuration Manager. Add a x64 configuration, copying the configuration from Win32. Be sure  that it adds the configuration to all the projects.  Now compile.  For the 64-bit build, you will also need to disable X11 support.  Edit magick-config.h and undefine the MAGICKCORE_X11_DELEGATE define.</p>
238
239 </div>
240
241 <h2><a id="Build"></a>Build</h2>
242 <div class="doc-section">
243
244 <p>After creating your build environment, proceed to open the DSW (or SLN) workspace in the <code>VisualMagick</code> folder.  In the DSW file choose the <em>All</em> project to make it the <em>active</em> project.  Set the build configuration to the desired one (Debug, or Release) and <em>clean</em> and <em>build:</em></p>
245
246 <ol>
247   <li>Right click on the All project and select <em>Set As Active Project</em></li>
248   <li>Select "Build=&gt;Clean Solution"</li>
249         <li>Select "Build=&gt;Build Solution"</li>
250 </ol>
251
252 <p>The <em>clean</em> step is necessary in order to make sure that all of the target support libraries are updated with any patches needed to get them to compile properly under Visual Studio.</p>
253
254 <p>After a successful build, all of the required files that are needed to run any of the <a href="command-line-tools.html">command line tools</a> are located in the <code>VisualMagick\bin</code> folder.  This includes EXE, DLL libraries, and ImageMagick configuration files.  You should be able to test the build directly from this directory without having to move anything to any of the global SYSTEM or SYSTEM32 areas in the operating system installation.</p>
255
256 <p>The Visual Studio distribution of ImageMagick comes with the Magick++ C++ wrapper by default. This add-on layer has a large number of demo and test files that can be found in <code>ImageMagick\Magick++\demo</code>, and <code>ImageMagick\Magick++\tests</code>. There are also a variety of tests that use the straight C API as well in ImageMagick\tests.</p>
257
258 <p> All of these programs are <em>not</em> configured to be built in the default workspace created by the configure program. You can cause all of these demos and test programs to be built by checking the box in configure that says:</p>
259
260 <p class="text">
261   Include all demo and test programs
262 </p>
263
264 <p>In addition, there is another related checkbox (checked by default) that causes all generated project files to be created standalone so that they can be copied to other areas of you system.</p>
265
266 <p>This the checkbox:</p>
267
268 <p class="text">
269   Generate all utility projects with full paths rather then relative paths.
270 </p>
271
272 <p>Visual Studio uses a concept of <em>dependencies</em> that tell it what other components need to be build when a particular project is being build. This mechanism is also used to ensure that components link properly. In my normal development environment, I want to be able to make changes and debug the system as a whole, so I like and NEED to use dependencies. However, most end users don't want to work this way.</p>
273
274 <p>Instead they really just want to build the package and then get down to business working on their application. The solution is to make all the utility projects (UTIL_xxxx_yy_exe.dsp) use full absolute paths to all the things they need. This way the projects stand on their own and can actually be copied and used as templates to get a particular custom application compiling with little effort.</p>
275
276 <p>With this feature enabled, you should be able to nab a copy of</p>
277
278 <p class="text">
279   VisualMagick\utilities\UTIL_convert_xxx_exe.dsp  (for C) or  <br></br>
280   VisualMagick\Magick++\demo\UTIL_demo_xxx_exe.dsp (for C++)
281 </p>
282
283 <p>and pop it into Notepad, modify it (carefully) to your needs and be on your way to happy compiling and linking.</p>
284
285 <p> You can feel free to pick any of the standard utilities, tests, or demo programs as the basis for a new program by copying the project and the source and hacking away.</p>
286
287 <p>The choice of what to use as a starting point is very easy.</p>
288
289 <p>For straight C API command line applications use something from:</p>
290
291 <p class="text">
292   ImageMagick\tests or  <br></br>
293   ImageMagick\utilities (source code) or <br></br>
294   ImageMagick\VisualMagick\tests or  <br></br>
295   ImageMagick\Visualmagick\utilities (project - DSP)
296 </p>
297
298 <p>For C++ and Magick++ command line applications use something from:</p>
299
300 <p class="text">
301   ImageMagick\Magick++\tests or ImageMagick\Magick++\demo (source code) or <br></br>
302   ImageMagick\VisualMagick\Magick++\tests or  <br></br>
303   ImageMagick\VisualMagick\Magick++\demo (project - DSP)
304 </p>
305
306 <p>For C++ and Magick++ and MFC windows applications use:</p>
307
308 <p class="text">
309   ImageMagick\contrib\win32\MFC\NtMagick (source code) or <br></br>
310   ImageMagick\VisualMagick\contrib\win32\MFC\NtMagick (project - DSP)
311 </p>
312
313 <p>The ImageMagick distribution is very modular. The default configuration is there to get you rolling, but you need to make some serious choices when you wish to change things around.</p>
314
315 <p>The default options are all targeted at having all the components in one place (e.g. the <code>bin</code> directory of the VisualMagick build tree). These components may be copied to another folder (such as to another computer).</p>
316
317 <p>The folder containing the executables and DLLs should contain the following files:</p>
318
319 <ol>
320   <li>magic.xml</li>
321   <li>delegates.xml</li>
322   <li>modules.xml</li>
323   <li>colors.xml</li>
324 </ol>
325
326 <p>among others.</p>
327
328 <p>The <code>bin</code> folder should contains all EXE's and DLL's as well as the very important <code>modules.xml</code> file.</p>
329
330 <p>With this default setup, you can use any of the command line tools and run scripts as normal. You can actually get by quite nicely this way by doing something like <code>pushd e:\xxx\yyy\bin</code> in any scripts you write to execute <em>out of</em> this directory.</p>
331
332 <p>By default the core of ImageMagick on Win32 always looks in the place were the exe program is run from in order to find all of the files as well as the DLL's it needs.</p>
333
334         <h3>ENVIRONMENT VARIABLES</h3>
335         <div class="doc-section">
336
337                 <p>You can use the <em>System</em> control panel to allow you to add and delete what is in any of the environment variables. You can even have user specific environment variables if you wish.</p>
338
339                 <h4>PATH</h4>
340                 <div class="doc-section">
341                   <p>This environmental variable sets the default list of places were Windows looks for EXE's and DLL's. Windows CMD shell seems to look in the <em>current</em> directory first no matter what, which may make it unnecessary to update the PATH. If you wish to run any of utilities from another location then you must add the path to your <code>bin</code> directory in. For instance, to do this for the default build environment like I do, you might add:</p>
342
343
344                         <p class="text">
345                           C:\ImageMagick\VisualMagick\bin
346                         </p>
347
348                 </div>
349
350                 <h4>MAGICK_HOME</h4>
351                 <div class="doc-section">
352                   <p>If all you do is modify the PATH variable, the first problem you will run into is that ImageMagick may not be able to find any of its <em>modules</em>. Modules are all the IM_MOD*.DLL files you see in the distribution. There is one of these for each and every file format that ImageMagick supports. This environment variable tells the system were to look for these DLL's. The compiled in <em>default</em> is <em>execution path</em> - which says - look in the same place that the application is running <em>in</em>. If you are running from somewhere other then <code>bin</code> - this will no longer work and you must use this variable. If you elect to leave the modules in the same place as the EXE's (a good idea) then you can simply set this to the same place as you did the PATH variable. In my case:</p>
353
354                         <p class="text">
355                           C:\ImageMagick\coders
356                         </p>
357
358                         <p>This also the place were ImageMagick expects to find the <code>colors.xml</code>, <code>delegates.xml</code>, <code>magic.xml</code>, <code>modules.xml</code>, and <code>type.xml</code> files.</p>
359                 </div>
360         </div>
361
362 <p>One cool thing about the modules build of ImageMagick is that you can now leave out file formats and lighten you load. If all you ever need is GIF and JPEG, then simply drop all the other DLL's into the local trash can and get on with your life.</p>
363
364 <p>Always keep the XC format, since ImageMagick uses it internally.</p>
365
366 <p>You can elect to changes these things the good old <em>hard-coded</em> way. This define is applicable in <code>magick-config.h</code>:</p>
367
368 <p class="text">
369   #define MagickConfigurePath  "C:\\ImageMagick\\"
370 </p>
371
372 <p>To view any image in a Microsoft window, type</p>
373
374 <p class="crt"><span class="crtprompt"> $magick&gt; </span><span class="crtin">convert image.ext win:</span></p>
375 <p>Make sure <a href="http://www.cs.wisc.edu/~ghost/">Ghostscript</a> is installed, otherwise, you will be unable to convert or view a Postscript document, and Postscript standard fonts will not be available.</p>
376
377 <p>You may use any standard web browser (e.g. Internet Explorer) to browse the ImageMagick documentation.</p>
378
379 <p>The Win2K executables will work under Windows 98.</p>
380
381 <p>ImageMagick is now configured and built. You can optionally install it on your system as discussed below.</p>
382
383 <p>If you are looking to install the ImageMagick COM+ object, see <a href="ImageMagickObject.html">Installing the ImageMagickObject COM+ Component</a>.</p>
384
385 </div>
386
387 <h2><a id="Install"></a>Install</h2>
388 <div class="doc-section">
389
390 <p>You can run ImageMagick command line utilities directly from the <code>VisualMagick\bin</code> folder, however, in most cases you may want the convenience of an installer script.  ImageMagick provides <a href="http://www.jrsoftware.org">Inno Setup</a> scripts for this purpose.  Note, you must define MAGICKCORE_INSTALLED_SUPPORT at <a href="advanced-windows-installation.html#configure">configure</a> time to utilize the installer scripts.</p>
391
392 <p>To get started building a self-installing ImageMagick executable, go to <code>VisualMagick\installer</code> folder and click on a script that matches your build environment.  Press F9 to build and install ImageMagick.  The default location is <code>C:Program Files\ImageMagick-6.?.?\Q?</code>.  The exact folder name depends on the ImageMagick version and quantum depth.  Once installed, ImageMagick command line utilities and libraries are available to the MS Command Prompt, web scripts, or to meet your development needs.</p>
393
394 </div>
395
396 <h2><a id="binary"></a>Create a Self-Installing Binary Distribution</h2>
397 <div class="doc-section">
398
399 <h3>Prerequisites</h3>
400
401         <ol>
402         <li>Download and install <a href="http://www.jrsoftware.org/isdl.html">Inno Setup 5</a>.</li>
403         <li>Download and install <a href="http://www.activestate.com/activeperl/downloads">ActiveState ActivePerl</a>.</li>
404         </ol>
405
406 <h3>Run the Configure Wizard</h3>
407
408         <ol>
409         <li>Double-click on <code>VisualMagick/configure/configure.sln</code> to build the configure wizard.</li>
410         <li>Select <code>Rebuild All</code> and launch the configure wizard.</li>
411         <li>Uncheck <code>Use X11 Stubs</code> and check <code>Build demo and test programs</code>.</li>
412         <li>Click on <code>Edit magick_config.h</code> and define <code>MAGICKCORE_INSTALLED_SUPPORT</code>.</li>
413         <li>Complete the configure wizard screens to create the ImageMagick Visual C++ workspace.</li>
414         </ol>
415
416 <h3>Build ImageMagick</h3>
417
418         <ol>
419         <li>Double-click on <code>VisualMagick/VisualDynamicMT.sln</code> to launch the ImageMagick Visual workspace.</li>
420         <li>Set the active configuration to <code>Win32 Release</code>.</li>
421         <li>Select <code>Rebuild All</code> to build the ImageMagick binary distribution.</li>
422         </ol>
423
424 <h3>Build ImageMagickObject</h3>
425
426         <ol>
427         <li>Launch the Command Prompt application and move to the <code>contrib\win32\ATL7\ImageMagickObject</code> folder.</li>
428         <li>Build ImageMagickObject with these commands:
429         <p class="crt"><span class="crtprompt"> $magick&gt; </span><span class="crtin">BuildImageMagickObject clean</span><span class="crtout"></span><span class="crtprompt"> $magick&gt; </span><span class="crtin">BuildImageMagickObject release</span></p></li>
430         </ol>
431
432 <h3>Build PerlMagick</h3>
433
434         <ol>
435         <li>Launch the Command Prompt application and move to the <code>PerlMagick</code> folder.</li>
436         <li>Build PerlMagick with these commands:
437         <p class="crt"><span class="crtprompt"> $magick&gt; </span><span class="crtin">perl Makefile.nt</span><span class="crtout"></span><span class="crtprompt"> $magick&gt; </span><span class="crtin">nmake release</span></p></li>
438         </ol>
439
440 <h3>Create the Self-installing ImageMagick Binary Distribution</h3>
441
442         <ol>
443         <li>Double-click on <code>VisualMagick/installer/im-dll-16.iss</code> to launch the Inno Setup 5 wizard.</li>
444         <li>Select <code>File-&gt;Compile</code>.</li>
445         </ol>
446
447 <h3>Install the Binary Distribution</h3>
448
449         <ol>
450         <li>Double-click on
451         <code>VisualMagick/bin/ImageMagick-7.0.0-0-Q16-windows-dll.exe</code>
452         to launch the ImageMagick binary distribution.</li>
453         <li>Complete the installer screens to install ImageMagick on your system.</li>
454         </ol>
455
456 <h3>Test the Binary Distribution</h3>
457
458         <ol>
459         <li>Launch the Command Prompt application and move to the <code>PerlMagick</code> folder and type
460         <p class="crt"><span class="crtprompt"> $magick&gt; </span><span class="crtin">nmake test</span></p></li>
461
462         <li>Move to the <code>VisualMagick/tests</code> folder and type
463         <p class="crt"><span class="crtprompt"> $magick&gt; </span><span class="crtin">validate</span></p></li>
464         <li>Move to the <code>VisualMagick/Magick++/tests</code> folder and type
465         <p class="crt"><span class="crtprompt"> $magick&gt; </span><span class="crtin">run_tests.bat</span></p></li>
466         <li>Move to the <code>VisualMagick/Magick++/demo</code> folder and type
467         <p class="crt"><span class="crtprompt"> $magick&gt; </span><span class="crtin">run_demos.bat</span></p></li>
468         </ol>
469
470 <p>If all the tests pass without complaint, the ImageMagick self-install binary distribution is ready for use.</p>
471
472 </div>
473
474 <h2><a id="problems"></a>Dealing with Unexpected Problems</h2>
475 <div class="doc-section">
476
477 <p>Chances are the download, configure, build, and install of ImageMagick went flawlessly as it is intended, however, certain systems and environments may cause one or more steps to fail.  We discuss a few problems we've run across and how to take corrective action to ensure you have a working release of ImageMagick.</p>
478
479 <p>If the compiler generates an error or if it quits unexpectedly, go to the <a href="http://msdn.microsoft.com/vstudio/">Visual Studio</a> web site and look for Visual Studio service packs.  Chances are, after you download and install all the Visual Studio service packs, ImageMagick will compile and build as expected.</p>
480
481 </div>
482
483 <h2><a id="project"></a>Building Your Custom Project</h2>
484 <div class="doc-section">
485
486 <p>The Windows <a href="binary-releases.html#windows">binary</a> distribution includes a number of demo projects that you can use as a template for your own custom project.  For example, start with the Button project, generally located in the <code>c:/Program Files/ImageMagick-6.5.5-0/Magick++_demos</code> folder.  If not, be sure to select <code>Configuration Properties-&gt;C/C++-&gt;Preprocessor</code> and set these definitions:</p>
487
488 <pre class="text">
489   NDEBUG
490   WIN32
491   _CONSOLE
492   _VISUALC_
493   NeedFunctionPrototypes
494   _DLL
495   _MAGICKMOD_
496 </pre>
497
498 </div>
499
500 </div>
501
502 <div id="linkbar">
503     <span id="linkbar-west"> </span>
504
505     <span id="linkbar-center">
506       <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
507       <a href="../discourse-server">Discourse Server</a> •
508       <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a> •
509       <a href="http://jqmagick.imagemagick.org/">JqMagick</a>
510     </span>
511     <span id="linkbar-east"> </span>
512 </div>
513 <div class="footer">
514   <span id="footer-west">©  1999-2013 ImageMagick Studio LLC</span>
515   <span id="footer-east"> <a href="contact.html">Contact the Wizards</a></span>
516 </div>
517 <div style="clear: both; margin: 0; width: 100%; "></div>
518 </body>
519 </html>