From 77877abfdb4d7ffe42ad556a5b012ac176d5f1ab Mon Sep 17 00:00:00 2001
From: Rich Megginson <rmeggins@redhat.com>
Date: Thu, 5 Nov 2009 17:06:52 -0700
Subject: [PATCH] Add 64-bit support - Use replaceable parameters for names, guids
 I merged in the changes from PassSync to add
 * 64-bit support
 * VC runtime merge modules
 * replaceable parameters to allow easily changing the brand, vendor,
   version, guids
 To make a release now, just edit VERSION.mak, change the VERSION and PKGGUID

---
 win/.gitignore             |    1 +
 win/389-console.bat        |   79 -------
 win/389Logo.ico            |  Bin 2238 -> 0 bytes
 win/Console.wxs            |  491 +++++++++++++++++++++++---------------------
 win/FedoraLogo.ico         |  Bin 2238 -> 0 bytes
 win/Logo389.ico            |  Bin 0 -> 2238 bytes
 win/Makefile               |  397 ++++++++++++++++++++----------------
 win/VERSION.mak            |   24 +++
 win/build.bat              |   74 +++++++
 win/fedora-idm-console.bat |   79 -------
 win/template.bat           |   79 +++++++
 win/unzip.vbs              |  142 +++++++-------
 12 files changed, 727 insertions(+), 639 deletions(-)
 create mode 100644 win/.gitignore
 delete mode 100755 win/389-console.bat
 delete mode 100644 win/389Logo.ico
 delete mode 100644 win/FedoraLogo.ico
 create mode 100644 win/Logo389.ico
 create mode 100644 win/VERSION.mak
 create mode 100644 win/build.bat
 delete mode 100755 win/fedora-idm-console.bat
 create mode 100644 win/template.bat

diff --git a/win/.gitignore b/win/.gitignore
new file mode 100644
index 0000000..2dcac3b
--- /dev/null
+++ b/win/.gitignore
@@ -0,0 +1 @@
+build.WIN*
diff --git a/win/389-console.bat b/win/389-console.bat
deleted file mode 100755
index 671fae9..0000000
--- a/win/389-console.bat
+++ /dev/null
@@ -1,79 +0,0 @@
-echo off
-rem BEGIN COPYRIGHT BLOCK
-rem Copyright (C) 2005 Red Hat, Inc.
-rem All rights reserved.
-rem
-rem This library is free software; you can redistribute it and/or
-rem modify it under the terms of the GNU Lesser General Public
-rem License as published by the Free Software Foundation version
-rem 2.1 of the License.
-rem                                                                                 
-rem This library is distributed in the hope that it will be useful,
-rem but WITHOUT ANY WARRANTY; without even the implied warranty of
-rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-rem Lesser General Public License for more details.
-rem                                                                                 
-rem You should have received a copy of the GNU Lesser General Public
-rem License along with this library; if not, write to the Free Software
-rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-rem END COPYRIGHT BLOCK
-
-rem set the JAVA to use here
-rem set JAVA=C:\j2sdk1.4.2_15\bin\java
-
-if not "%JAVA%foo"=="foo" goto launch
-
-java -version > nul 2>&1 || goto findjre
-
-set JAVA=java
-goto launch
-
-:findjre
-rem look for Java Runtime Environment in registry
-reg QUERY "HKLM\SOFTWARE\JavaSoft\Java Runtime Environment" > nul 2>&1 || goto findjdk
-
-rem can we grab the java location from the registry?
-rem set JAVA=path\bin\java
-rem apparently not, in a batch file
-rem goto launch
-echo The Java Runtime Environment is installed on this machine, but the
-echo command java.exe is not in your PATH.  You can either make sure java.exe
-echo is in the PATH, or edit this script to set JAVA to the full path of
-echo java.exe
-pause
-goto end
-
-:findjdk
-reg QUERY "HKLM\SOFTWARE\JavaSoft\Java Development Kit" > nul 2>&1 || goto nojava
-
-rem can we grab the java location from the registry?
-rem set JAVA=path\bin\java
-rem goto launch
-echo The Java Development Kit is installed on this machine, but the
-echo command java.exe is not in your PATH.  You can either make sure java.exe
-echo is in the PATH, or edit this script to set JAVA to the full path of
-echo java.exe
-pause
-goto end
-
-:nojava
-echo Java does not appear to be installed on this machine.  Please download and install the Java Runtime Environment and make sure the java.exe command is in the PATH of this command.
-pause
-goto end
-
-:launch
-set BASEPATH=.
-set 389CONSOLEJARDIR=%BASEPATH%
-set CONSOLEJARDIR=%BASEPATH%
-set JSSDIR=%BASEPATH%
-set LDAPJARDIR=%BASEPATH%
-
-set PATH=%BASEPATH%;%PATH%
-
-rem
-rem Launch the Console
-rem
-echo on
-"%JAVA%" "-Djava.library.path=%JSSDIR%" -cp "%JSSDIR%/jss4.jar;%LDAPJARDIR%/ldapjdk.jar;%CONSOLEJARDIR%/idm-console-base.jar;%CONSOLEJARDIR%/idm-console-mcc.jar;%CONSOLEJARDIR%/idm-console-mcc_en.jar;%CONSOLEJARDIR%/idm-console-nmclf.jar;%CONSOLEJARDIR%/idm-console-nmclf_en.jar;%389CONSOLEJARDIR%/389-console_en.jar" -Djava.util.prefs.systemRoot=%HOME%/.389-console -Djava.util.prefs.userRoot=%HOME%/.389-console com.netscape.management.client.console.Console %*
-
-:end
diff --git a/win/389Logo.ico b/win/389Logo.ico
deleted file mode 100644
index 06a7da343b7de7bbae0f63838536305adbf717fc..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/win/Console.wxs b/win/Console.wxs
index 3fd6433..2e3ce3d 100644
--- a/win/Console.wxs
+++ b/win/Console.wxs
@@ -1,234 +1,257 @@
-<?xml version='1.0' encoding='windows-1252'?>
-<!-- BEGIN COPYRIGHT BLOCK
- This Program is free software; you can redistribute it and/or modify it under
- the terms of the GNU General Public License as published by the Free Software
- Foundation; version 2 of the License.
- 
- This Program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- 
- You should have received a copy of the GNU General Public License along with
- this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
- Place, Suite 330, Boston, MA 02111-1307 USA.
-
- In addition, as a special exception, Red Hat, Inc. gives You the additional
- right to link the code of this Program with code not covered under the GNU
- General Public License ("Non-GPL Code") and to distribute linked combinations
- including the two, subject to the limitations in this paragraph. Non-GPL Code
- permitted under this exception must only link to the code of this Program
- through those well defined interfaces identified in the file named EXCEPTION
- found in the source code files (the "Approved Interfaces"). The files of
- Non-GPL Code may instantiate templates or use macros or inline functions from
- the Approved Interfaces without causing the resulting work to be covered by
- the GNU General Public License. Only Red Hat, Inc. may make changes or
- additions to the list of Approved Interfaces. You must obey the GNU General
- Public License in all respects for all of the Program code and other code used
- in conjunction with the Program except the Non-GPL Code covered by this
- exception. If you modify this file, you may extend this exception to your
- version of the file, but you are not obligated to do so. If you do not wish to
- provide this exception without modification, you must delete this exception
- statement from your version and license this file solely under the GPL without
- exception. 
-
-
- Copyright (C) 2007 Red Hat, Inc.
- All rights reserved.
- END COPYRIGHT BLOCK -->
-<Wix xmlns='http://schemas.microsoft.com/wix/2003/01/wi'>
-  <Product Name='389 Management Console' Id='36C8F6DB-6C1B-416e-83E4-31A0688EBD3F'
-    Language='1033' Codepage='1252' UpgradeCode='7EA828C0-C219-438d-9BB3-3418DC900D60'
-    Version='1.1.2' Manufacturer='389 Project'>
-
-    <Package Id='????????-????-????-????-????????????' Keywords='Installer'
-      Description="389 Management Console Installer"
-      Manufacturer='389 Project'
-      InstallerVersion='100' Languages='1033' Compressed='yes' SummaryCodepage='1252' />
-
-    <Upgrade Id='7EA828C0-C219-438d-9BB3-3418DC900D60'>
-      <UpgradeVersion OnlyDetect='no' Property='PATCHFOUND'
-        IncludeMinimum='yes' Minimum='1.1.0' Maximum='1.1.1' IncludeMaximum='yes' />
-      <UpgradeVersion OnlyDetect='yes' Property='NEWERFOUND'
-        Minimum='1.1.2' IncludeMinimum='no' />
-    </Upgrade>
-
-    <Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
-    <Property Id='DiskPrompt' Value="Console Installation [1]" />
-
-    <CustomAction Id='AlreadyUpdated' Error='[ProductName] [ProductVersion] is already installed.' />
-    <CustomAction Id='NoDowngrade' Error='A later version of [ProductName] is already installed.' />
-
-    <Directory Id='TARGETDIR' Name='SourceDir'>
-
-      <Directory Id='ProgramFilesFolder' Name='PFiles'>
-
-        <Directory Id='INSTALLDIR' Name='389CON' LongName='389 Management Console'>
-
-          <Component Id='NSPRLibrary' Guid='DE133754-3C99-49e7-8A71-0375AB348CDD'>
-            <File Id='NSPR' LongName='libnspr4.dll' Name='libnspr4.dll' DiskId='1' src='libnspr4.dll' Vital='yes' />
-          </Component>
-
-          <Component Id='NSPRpldsLibrary' Guid='7DCDBD30-DC5B-4c89-BD94-EE55E1D9D082'>
-            <File Id='NSPRPLDS' LongName='libplds4.dll' Name='libplds4.dll' DiskId='1' src='libplds4.dll' Vital='yes' />
-          </Component>
-
-          <Component Id='NSPRplcLibrary' Guid='4E707871-BA8E-41e2-982E-E3E79E85A599'>
-            <File Id='NSPRPLC' LongName='libplc4.dll' Name='libplc4.dll' DiskId='1' src='libplc4.dll' Vital='yes' />
-          </Component>
-
-          <Component Id='NSSLibrary' Guid='3196F339-901E-42c4-AAD3-704775DCF5F4'>
-            <File Id='NSS' LongName='nss3.dll' Name='nss3.dll' DiskId='1' src='nss3.dll' Vital='yes' />
-          </Component>
-
-          <Component Id='NSSsslLibrary' Guid='004E7F81-77E8-4681-810B-E97EC9BE49F2'>
-            <File Id='NSSSSL' LongName='ssl3.dll' Name='ssl3.dll' DiskId='1' src='ssl3.dll' Vital='yes' />
-          </Component>
-
-          <Component Id='NSSsoftoknLibrary' Guid='B20D5FB4-B985-4c44-B4AA-8657C74B8061'>
-            <File Id='NSSSOFTTOKN' LongName='softokn3.dll' Name='softokn3.dll' DiskId='1' src='softokn3.dll' Vital='yes' />
-          </Component>
-
-          <Component Id='NSSsmimeLibrary' Guid='84BD3153-5E80-4556-9B6C-C67B13B3BEA9'>
-            <File Id='NSSSMIME' LongName='smime3.dll' Name='smime3.dll' DiskId='1' src='smime3.dll' Vital='yes' />
-          </Component>
-
-          <Component Id='NSSfreeblLibrary' Guid='69D9F77F-27EA-4820-B931-07538AFC75FD'>
-            <File Id='NSSFREEBL' LongName='freebl3.dll' Name='freebl3.dll' DiskId='1' src='freebl3.dll' Vital='yes' />
-          </Component>
-
-          <Component Id='NSSutilLibrary' Guid='FCFD9F8C-E567-46eb-90C3-A9322E862A2C'>
-            <File Id='NSSUTIL' LongName='nssutil3.dll' Name='nssutil3.dll' DiskId='1' src='nssutil3.dll' Vital='yes' />
-          </Component>
-
-          <Component Id='NSSsqliteLibrary' Guid='4A8645BA-7A78-44f5-8073-7F2BE8C13622'>
-            <File Id='NSSSQLITE' LongName='sqlite3.dll' Name='sqlite3.dll' DiskId='1' src='sqlite3.dll' Vital='yes' />
-          </Component>
-
-          <Component Id='NSSdbmLibrary' Guid='7BDF98E8-D1D5-4b06-AB69-1688EE7A6872'>
-            <File Id='NSSDBM' LongName='nssdbm3.dll' Name='nssdbm3.dll' DiskId='1' src='nssdbm3.dll' Vital='yes' />
-          </Component>
-
-          <Component Id='NSSrootcertsLibrary' Guid='B3350485-7CDD-4311-99F6-479DA1FA92A1'>
-            <File Id='NSSROOTCERTS' LongName='nssckbi.dll' Name='nssckbi.dll' DiskId='1' src='nssckbi.dll' Vital='yes' />
-          </Component>
-
-          <Component Id='NSScertutil' Guid='7741A56D-3E96-4823-AC0F-0B81A696651F'>
-            <File Id='NSSCERTUTIL' LongName='certutil.exe' Name='certutil.exe' DiskId='1' src='certutil.exe' Vital='yes' />
-          </Component>
-
-          <Component Id='NSSpk12util' Guid='F10ABF8A-8C10-49f6-8150-45616EA4C360'>
-            <File Id='NSSPK12UTIL' LongName='pk12util.exe' Name='pk12util.exe' DiskId='1' src='pk12util.exe' Vital='yes' />
-          </Component>
-
-          <Component Id='JSSLibrary' Guid='844240DD-3EE8-444e-BA48-5C114648096B'>
-            <File Id='JSSLIB' LongName='jss4.dll' Name='jss4.dll' DiskId='1' src='jss4.dll' Vital='yes' />
-          </Component>
-
-          <Component Id='JSSJar' Guid='064A960B-4D7E-45cc-895B-19DE1D9AEF77'>
-            <File Id='JSSJAR' LongName='jss4.jar' Name='jss4.jar' DiskId='1' src='jss4.jar' Vital='yes' />
-          </Component>
-
-          <Component Id='LDAPJar' Guid='E6D5B3AE-11F5-427f-85D3-D7A6A6A0A55D'>
-            <File Id='LDAPJAR' LongName='ldapjdk.jar' Name='ldapjdk.jar' DiskId='1' src='ldapjdk.jar' Vital='yes' />
-          </Component>
-
-          <Component Id='IDMBaseJar' Guid='F45C344F-A3C2-4ffd-9CC6-22D36AA5E69E'>
-            <File Id='IDMBASEJAR' LongName='idm-console-base.jar' Name='idmbase.jar' DiskId='1' src='idm-console-base.jar' Vital='yes' />
-          </Component>
-
-          <Component Id='IDMMCCJar' Guid='1DB26BB6-56AF-4e7e-BD55-8F1364B7A55B'>
-            <File Id='IDMMCCJAR' LongName='idm-console-mcc.jar' Name='idmmcc.jar' DiskId='1' src='idm-console-mcc.jar' Vital='yes' />
-          </Component>
-
-          <Component Id='IDMMCCENJar' Guid='71FF3A08-C895-4648-A8CC-08F0CD2AD4D6'>
-            <File Id='IDMMCCENJAR' LongName='idm-console-mcc_en.jar' Name='idmmccen.jar' DiskId='1' src='idm-console-mcc_en.jar' Vital='yes' />
-          </Component>
-
-          <Component Id='IDMNMCLFJar' Guid='2F118B1B-3413-4740-A99A-1B22E79AB232'>
-            <File Id='IDMNMCLFJAR' LongName='idm-console-nmclf.jar' Name='idmnmclf.jar' DiskId='1' src='idm-console-nmclf.jar' Vital='yes' />
-          </Component>
-
-          <Component Id='IDMNMCLFENJar' Guid='EB4F2170-BFDC-4c5f-8A12-9812CAADB740'>
-            <File Id='IDMNMCLFENJAR' LongName='idm-console-nmclf_en.jar' Name='idmnmcen.jar' DiskId='1' src='idm-console-nmclf_en.jar' Vital='yes' />
-          </Component>
-
-          <Component Id='389ConsoleJar' Guid='BE426443-1A07-406e-97FA-103D518BE233'>
-            <File Id='389CONSOLEJAR' LongName='389-console_en.jar' Name='389en.jar' DiskId='1' src='389-console_en.jar' Vital='yes' />
-          </Component>
-
-          <Component Id='389ConsoleBat' Guid='00DEC033-5D77-49a2-9478-FA67E8D4EFEA'>
-            <File Id='389CONSOLEBAT' LongName='389-console.bat' Name='389con.bat' DiskId='1' src='389-console.bat' Vital='yes' >
-                <Shortcut Id="startmenu389Console" Directory="ProgramMenuDir" Name="389CON" 
-                  LongName="389 Console" WorkingDirectory='INSTALLDIR'
-                  Icon="389Logo.ico" IconIndex="0" />
-                <Shortcut Id="desktop389Console" Directory="DesktopFolder" Name="389CON"
-                  LongName="389 Console" WorkingDirectory='INSTALLDIR'
-                  Icon="389Logo.ico" IconIndex="0" />
-            </File>
-          </Component>
-
-          <Component Id='License.rtf' Guid='D40977B8-BB2B-4796-B855-3503AF5FF881'>
-            <File Id='LICENSERTF' LongName='License.rtf' Name='License.rtf' DiskId='1' src='License.rtf' Vital='yes' />
-          </Component>
-
-        </Directory>
-
-      </Directory>
-
-      <Directory Id="ProgramMenuFolder" Name="PMenu" LongName="Programs">
-        <Directory Id="ProgramMenuDir" Name='389CON' LongName="389 Management Console" />
-      </Directory>
-
-      <Directory Id="DesktopFolder" Name="Desktop" />
-
-    </Directory>
-
-    <Feature Id='Complete' Title='389 Management Console' Description='The complete package.'
-      TypicalDefault='install' Display='expand' Level='1'
-      ConfigurableDirectory='INSTALLDIR'>
-      <Feature Id='MainProgram' Title='Program' Description='The main executable.'
-        TypicalDefault='install' Level='1'>
-	    <ComponentRef Id='NSPRLibrary' />
-	    <ComponentRef Id='NSPRpldsLibrary' />
-	    <ComponentRef Id='NSPRplcLibrary' />
-	    <ComponentRef Id='NSSLibrary' />
-	    <ComponentRef Id='NSSsslLibrary' />
-	    <ComponentRef Id='NSSsoftoknLibrary' />
-	    <ComponentRef Id='NSSsmimeLibrary' />
-	    <ComponentRef Id='NSSfreeblLibrary' />
-	    <ComponentRef Id='NSSutilLibrary' />
-	    <ComponentRef Id='NSSsqliteLibrary' />
-	    <ComponentRef Id='NSSdbmLibrary' />
-	    <ComponentRef Id='NSSrootcertsLibrary' />
-	    <ComponentRef Id='NSScertutil' />
-	    <ComponentRef Id='NSSpk12util' />
-	    <ComponentRef Id='JSSLibrary' />
-	    <ComponentRef Id='JSSJar' />
-	    <ComponentRef Id='LDAPJar' />
-	    <ComponentRef Id='IDMBaseJar' />
- 	    <ComponentRef Id='IDMMCCJar' />
- 	    <ComponentRef Id='IDMMCCENJar' />
- 	    <ComponentRef Id='IDMNMCLFJar' />
- 	    <ComponentRef Id='IDMNMCLFENJar' />
- 	    <ComponentRef Id='389ConsoleJar' />
- 	    <ComponentRef Id='389ConsoleBat' />
- 	    <ComponentRef Id='License.rtf' />
-     </Feature>
-    </Feature>
-
-    <Property Id="INSTALLLEVEL">3</Property>
-
-    <UIRef Id="WixUI_Mondo" />
-    <UIRef Id="WixUI_ErrorProgressText" />
-
-    <InstallExecuteSequence>
-<!--      <Custom Action='AlreadyUpdated' After='FindRelatedProducts'>PATCHFOUND</Custom> -->
-      <Custom Action='NoDowngrade' After='FindRelatedProducts'>NEWERFOUND</Custom>
-      <RemoveExistingProducts After='InstallFinalize' />
-    </InstallExecuteSequence>
-
-    <Icon Id="389Logo.ico" SourceFile="389Logo.ico" />
-
-  </Product>
-
-</Wix>
+<?xml version='1.0' encoding='windows-1252'?>
+<!-- BEGIN COPYRIGHT BLOCK
+ This Program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
+ Foundation; version 2 of the License.
+ 
+ This Program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License along with
+ this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ Place, Suite 330, Boston, MA 02111-1307 USA.
+
+ In addition, as a special exception, Red Hat, Inc. gives You the additional
+ right to link the code of this Program with code not covered under the GNU
+ General Public License ("Non-GPL Code") and to distribute linked combinations
+ including the two, subject to the limitations in this paragraph. Non-GPL Code
+ permitted under this exception must only link to the code of this Program
+ through those well defined interfaces identified in the file named EXCEPTION
+ found in the source code files (the "Approved Interfaces"). The files of
+ Non-GPL Code may instantiate templates or use macros or inline functions from
+ the Approved Interfaces without causing the resulting work to be covered by
+ the GNU General Public License. Only Red Hat, Inc. may make changes or
+ additions to the list of Approved Interfaces. You must obey the GNU General
+ Public License in all respects for all of the Program code and other code used
+ in conjunction with the Program except the Non-GPL Code covered by this
+ exception. If you modify this file, you may extend this exception to your
+ version of the file, but you are not obligated to do so. If you do not wish to
+ provide this exception without modification, you must delete this exception
+ statement from your version and license this file solely under the GPL without
+ exception. 
+
+
+ Copyright (C) 2007 Red Hat, Inc.
+ All rights reserved.
+ END COPYRIGHT BLOCK -->
+<?if $(var.USE64)=1 ?>
+    <?define Property_PFilesFolder = "ProgramFiles64Folder" ?>
+    <?define Property_Win64 = "yes" ?>
+    <?define Property_Platform = "x64" ?>
+<?else ?>
+    <?define Property_PFilesFolder = "ProgramFilesFolder" ?>
+    <?define Property_Win64 = "no" ?>
+    <?define Property_Platform = "Intel" ?>
+<?endif ?>
+
+<Wix xmlns='http://schemas.microsoft.com/wix/2003/01/wi'>
+  <Product Name='$(var.PRODUCTNAME)' Id='$(var.PKGGUID)'
+    Language='1033' Codepage='1252' UpgradeCode='$(var.UPGRADEGUID)'
+    Version='$(var.VERSION)' Manufacturer='$(var.VENDOR)'>
+
+    <Package Id='????????-????-????-????-????????????' Keywords='Installer'
+      Description="$(var.PRODUCTNAME) Installer"
+      Manufacturer='$(var.VENDOR)' Platforms='$(var.Property_Platform)'
+      InstallerVersion='100' Languages='1033' Compressed='yes' SummaryCodepage='1252' />
+
+    <!-- previous versions of this package were installed using the per-user context -->
+    <!-- we cannot upgrade a per-machine package on top of a per-user package, nor -->
+    <!-- is there an easy way to convert a per-user package to a per-machine package -->
+    <!-- it seems the default changes per platform, so explicitly set this package -->
+    <!-- to be per-user -->
+    <Property Id='ALLUSERS' Value="2" />
+
+    <Upgrade Id='$(var.UPGRADEGUID)'>
+      <UpgradeVersion OnlyDetect='yes' Property='NEWERFOUND'
+        Minimum='$(var.VERSION)' IncludeMinimum='no' />
+    </Upgrade>
+
+    <Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
+    <Property Id='DiskPrompt' Value="Console Installation [1]" />
+
+    <CustomAction Id='AlreadyUpdated' Error='[ProductName] [ProductVersion] is already installed.' />
+    <CustomAction Id='NoDowngrade' Error='A later version of [ProductName] is already installed.' />
+
+    <Directory Id='TARGETDIR' Name='SourceDir'>
+      <!-- the VC runtime redist package -->
+      <Merge Id='CRT' Language='0' src='$(var.CRTMSM)' DiskId='1'/>
+      <Merge Id='PolicyCRT' Language='0' src='$(var.POLICYCRTMSM)' DiskId='1'/>
+
+      <Directory Id='$(var.Property_PFilesFolder)' Name='PFiles'>
+
+        <Directory Id='INSTALLDIR' Name='CONFLDR' LongName='$(var.PRODUCTNAME)'>
+
+          <Component Id='NSPRLibrary' Guid='DE133754-3C99-49e7-8A71-0375AB348CDD' Win64='$(var.Property_Win64)'>
+            <File Id='NSPR' LongName='libnspr4.dll' Name='libnspr4.dll' DiskId='1' src='libnspr4.dll' Vital='yes' />
+          </Component>
+
+          <Component Id='NSPRpldsLibrary' Guid='7DCDBD30-DC5B-4c89-BD94-EE55E1D9D082' Win64='$(var.Property_Win64)'>
+            <File Id='NSPRPLDS' LongName='libplds4.dll' Name='libplds4.dll' DiskId='1' src='libplds4.dll' Vital='yes' />
+          </Component>
+
+          <Component Id='NSPRplcLibrary' Guid='4E707871-BA8E-41e2-982E-E3E79E85A599' Win64='$(var.Property_Win64)'>
+            <File Id='NSPRPLC' LongName='libplc4.dll' Name='libplc4.dll' DiskId='1' src='libplc4.dll' Vital='yes' />
+          </Component>
+
+          <Component Id='NSSLibrary' Guid='3196F339-901E-42c4-AAD3-704775DCF5F4' Win64='$(var.Property_Win64)'>
+            <File Id='NSS' LongName='nss3.dll' Name='nss3.dll' DiskId='1' src='nss3.dll' Vital='yes' />
+          </Component>
+
+          <Component Id='NSSsslLibrary' Guid='004E7F81-77E8-4681-810B-E97EC9BE49F2' Win64='$(var.Property_Win64)'>
+            <File Id='NSSSSL' LongName='ssl3.dll' Name='ssl3.dll' DiskId='1' src='ssl3.dll' Vital='yes' />
+          </Component>
+
+          <Component Id='NSSsoftoknLibrary' Guid='B20D5FB4-B985-4c44-B4AA-8657C74B8061' Win64='$(var.Property_Win64)'>
+            <File Id='NSSSOFTTOKN' LongName='softokn3.dll' Name='softokn3.dll' DiskId='1' src='softokn3.dll' Vital='yes' />
+          </Component>
+
+          <Component Id='NSSsmimeLibrary' Guid='84BD3153-5E80-4556-9B6C-C67B13B3BEA9' Win64='$(var.Property_Win64)'>
+            <File Id='NSSSMIME' LongName='smime3.dll' Name='smime3.dll' DiskId='1' src='smime3.dll' Vital='yes' />
+          </Component>
+
+          <Component Id='NSSfreeblLibrary' Guid='69D9F77F-27EA-4820-B931-07538AFC75FD' Win64='$(var.Property_Win64)'>
+            <File Id='NSSFREEBL' LongName='freebl3.dll' Name='freebl3.dll' DiskId='1' src='freebl3.dll' Vital='yes' />
+          </Component>
+
+          <Component Id='NSSutilLibrary' Guid='FCFD9F8C-E567-46eb-90C3-A9322E862A2C' Win64='$(var.Property_Win64)'>
+            <File Id='NSSUTIL' LongName='nssutil3.dll' Name='nssutil3.dll' DiskId='1' src='nssutil3.dll' Vital='yes' />
+          </Component>
+
+          <Component Id='NSSsqliteLibrary' Guid='4A8645BA-7A78-44f5-8073-7F2BE8C13622' Win64='$(var.Property_Win64)'>
+            <File Id='NSSSQLITE' LongName='sqlite3.dll' Name='sqlite3.dll' DiskId='1' src='sqlite3.dll' Vital='yes' />
+          </Component>
+
+          <Component Id='NSSdbmLibrary' Guid='7BDF98E8-D1D5-4b06-AB69-1688EE7A6872' Win64='$(var.Property_Win64)'>
+            <File Id='NSSDBM' LongName='nssdbm3.dll' Name='nssdbm3.dll' DiskId='1' src='nssdbm3.dll' Vital='yes' />
+          </Component>
+
+          <Component Id='NSSrootcertsLibrary' Guid='B3350485-7CDD-4311-99F6-479DA1FA92A1' Win64='$(var.Property_Win64)'>
+            <File Id='NSSROOTCERTS' LongName='nssckbi.dll' Name='nssckbi.dll' DiskId='1' src='nssckbi.dll' Vital='yes' />
+          </Component>
+
+          <Component Id='NSScertutil' Guid='7741A56D-3E96-4823-AC0F-0B81A696651F' Win64='$(var.Property_Win64)'>
+            <File Id='NSSCERTUTIL' LongName='certutil.exe' Name='certutil.exe' DiskId='1' src='certutil.exe' Vital='yes' />
+          </Component>
+
+          <Component Id='NSSpk12util' Guid='F10ABF8A-8C10-49f6-8150-45616EA4C360' Win64='$(var.Property_Win64)'>
+            <File Id='NSSPK12UTIL' LongName='pk12util.exe' Name='pk12util.exe' DiskId='1' src='pk12util.exe' Vital='yes' />
+          </Component>
+
+          <Component Id='JSSLibrary' Guid='844240DD-3EE8-444e-BA48-5C114648096B' Win64='$(var.Property_Win64)'>
+            <File Id='JSSLIB' LongName='jss4.dll' Name='jss4.dll' DiskId='1' src='jss4.dll' Vital='yes' />
+          </Component>
+
+          <Component Id='JSSJar' Guid='064A960B-4D7E-45cc-895B-19DE1D9AEF77'>
+            <File Id='JSSJAR' LongName='jss4.jar' Name='jss4.jar' DiskId='1' src='jss4.jar' Vital='yes' />
+          </Component>
+
+          <Component Id='LDAPJar' Guid='E6D5B3AE-11F5-427f-85D3-D7A6A6A0A55D'>
+            <File Id='LDAPJAR' LongName='ldapjdk.jar' Name='ldapjdk.jar' DiskId='1' src='ldapjdk.jar' Vital='yes' />
+          </Component>
+
+          <Component Id='IDMBaseJar' Guid='F45C344F-A3C2-4ffd-9CC6-22D36AA5E69E'>
+            <File Id='IDMBASEJAR' LongName='idm-console-base.jar' Name='idmbase.jar' DiskId='1' src='idm-console-base.jar' Vital='yes' />
+          </Component>
+
+          <Component Id='IDMMCCJar' Guid='1DB26BB6-56AF-4e7e-BD55-8F1364B7A55B'>
+            <File Id='IDMMCCJAR' LongName='idm-console-mcc.jar' Name='idmmcc.jar' DiskId='1' src='idm-console-mcc.jar' Vital='yes' />
+          </Component>
+
+          <Component Id='IDMMCCENJar' Guid='71FF3A08-C895-4648-A8CC-08F0CD2AD4D6'>
+            <File Id='IDMMCCENJAR' LongName='idm-console-mcc_en.jar' Name='idmmccen.jar' DiskId='1' src='idm-console-mcc_en.jar' Vital='yes' />
+          </Component>
+
+          <Component Id='IDMNMCLFJar' Guid='2F118B1B-3413-4740-A99A-1B22E79AB232'>
+            <File Id='IDMNMCLFJAR' LongName='idm-console-nmclf.jar' Name='idmnmclf.jar' DiskId='1' src='idm-console-nmclf.jar' Vital='yes' />
+          </Component>
+
+          <Component Id='IDMNMCLFENJar' Guid='EB4F2170-BFDC-4c5f-8A12-9812CAADB740'>
+            <File Id='IDMNMCLFENJAR' LongName='idm-console-nmclf_en.jar' Name='idmnmcen.jar' DiskId='1' src='idm-console-nmclf_en.jar' Vital='yes' />
+          </Component>
+
+          <Component Id='ConsoleJar' Guid='BE426443-1A07-406e-97FA-103D518BE233'>
+            <File Id='CONSOLEJAR' LongName='$(var.FILEPREF)-console_en.jar' Name='conen.jar' DiskId='1' src='$(var.FILEPREF)-console_en.jar' Vital='yes' />
+          </Component>
+
+          <Component Id='ConsoleBat' Guid='00DEC033-5D77-49a2-9478-FA67E8D4EFEA'>
+            <File Id='CONSOLEBAT' LongName='$(var.FILEPREF)-console.bat' Name='con.bat' DiskId='1' src='$(var.FILEPREF)-console.bat' Vital='yes' >
+                <Shortcut Id="startmenuConsole" Directory="ProgramMenuDir" Name="CONFLDR" 
+                  LongName="$(var.PRODUCTNAME)" WorkingDirectory='INSTALLDIR'
+                  Icon="Logo$(var.BRANDNOSPACE).ico" IconIndex="0" Advertise="yes" />
+                <Shortcut Id="desktopConsole" Directory="DesktopFolder" Name="CONFLDR"
+                  LongName="$(var.PRODUCTNAME)" WorkingDirectory='INSTALLDIR'
+                  Icon="Logo$(var.BRANDNOSPACE).ico" IconIndex="0" Advertise="yes" />
+            </File>
+          </Component>
+
+          <Component Id='License.rtf' Guid='D40977B8-BB2B-4796-B855-3503AF5FF881'>
+            <File Id='LICENSERTF' LongName='License.rtf' Name='License.rtf' DiskId='1' src='License.rtf' Vital='yes' />
+          </Component>
+
+        </Directory>
+
+      </Directory>
+
+      <Directory Id="ProgramMenuFolder" Name="PMenu" LongName="Programs">
+        <Directory Id="ProgramMenuDir" Name='CONFLDR' LongName="$(var.PRODUCTNAME)" />
+      </Directory>
+
+      <Directory Id="DesktopFolder" Name="Desktop" />
+
+    </Directory>
+
+    <Feature Id='Complete' Title='$(var.PRODUCTNAME)' Description='The complete package.'
+      TypicalDefault='install' Display='expand' Level='1'
+      ConfigurableDirectory='INSTALLDIR'>
+      <Feature Id='MainProgram' Title='Program' Description='The main executable.'
+        TypicalDefault='install' Level='1'>
+	    <ComponentRef Id='NSPRLibrary' />
+	    <ComponentRef Id='NSPRpldsLibrary' />
+	    <ComponentRef Id='NSPRplcLibrary' />
+	    <ComponentRef Id='NSSLibrary' />
+	    <ComponentRef Id='NSSsslLibrary' />
+	    <ComponentRef Id='NSSsoftoknLibrary' />
+	    <ComponentRef Id='NSSsmimeLibrary' />
+	    <ComponentRef Id='NSSfreeblLibrary' />
+	    <ComponentRef Id='NSSutilLibrary' />
+	    <ComponentRef Id='NSSsqliteLibrary' />
+	    <ComponentRef Id='NSSdbmLibrary' />
+	    <ComponentRef Id='NSSrootcertsLibrary' />
+	    <ComponentRef Id='NSScertutil' />
+	    <ComponentRef Id='NSSpk12util' />
+	    <ComponentRef Id='JSSLibrary' />
+	    <ComponentRef Id='JSSJar' />
+	    <ComponentRef Id='LDAPJar' />
+	    <ComponentRef Id='IDMBaseJar' />
+ 	    <ComponentRef Id='IDMMCCJar' />
+ 	    <ComponentRef Id='IDMMCCENJar' />
+ 	    <ComponentRef Id='IDMNMCLFJar' />
+ 	    <ComponentRef Id='IDMNMCLFENJar' />
+ 	    <ComponentRef Id='ConsoleJar' />
+ 	    <ComponentRef Id='ConsoleBat' />
+ 	    <ComponentRef Id='License.rtf' />
+     </Feature>
+     <Feature Id='CRT_WinSXS' Title='CRT WinSXS' AllowAdvertise="no" Display="hidden" Level='1'>
+            <MergeRef Id='CRT' />
+	    <MergeRef Id='PolicyCRT' />
+     </Feature>
+    </Feature>
+
+    <Property Id="INSTALLLEVEL">3</Property>
+
+    <!-- we don't really allow fancy dialogs and customization, so just use minimal -->
+    <!--    <UIRef Id="WixUI_Mondo" /> -->
+    <UIRef Id="WixUI_Minimal" />
+    <UIRef Id="WixUI_ErrorProgressText" />
+
+    <InstallExecuteSequence>
+      <Custom Action='NoDowngrade' After='FindRelatedProducts'>NEWERFOUND</Custom>
+      <RemoveExistingProducts After='InstallFinalize' />
+    </InstallExecuteSequence>
+
+    <Icon Id="Logo$(var.BRANDNOSPACE).ico" SourceFile="Logo$(var.BRANDNOSPACE).ico" />
+
+  </Product>
+
+</Wix>
diff --git a/win/FedoraLogo.ico b/win/FedoraLogo.ico
deleted file mode 100644
index 7a46688edff84a8823584a8ad1c3c865351f653f..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/win/Logo389.ico b/win/Logo389.ico
new file mode 100644
index 0000000000000000000000000000000000000000..06a7da343b7de7bbae0f63838536305adbf717fc
GIT binary patch
diff --git a/win/Makefile b/win/Makefile
index 8156d37..cdb9fd8 100644
--- a/win/Makefile
+++ b/win/Makefile
@@ -1,176 +1,221 @@
-#
-# BEGIN COPYRIGHT BLOCK
-# This Program is free software; you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free Software
-# Foundation; version 2 of the License.
-# 
-# This Program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License along with
-# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place, Suite 330, Boston, MA 02111-1307 USA.
-# 
-# In addition, as a special exception, Red Hat, Inc. gives You the additional
-# right to link the code of this Program with code not covered under the GNU
-# General Public License ("Non-GPL Code") and to distribute linked combinations
-# including the two, subject to the limitations in this paragraph. Non-GPL Code
-# permitted under this exception must only link to the code of this Program
-# through those well defined interfaces identified in the file named EXCEPTION
-# found in the source code files (the "Approved Interfaces"). The files of
-# Non-GPL Code may instantiate templates or use macros or inline functions from
-# the Approved Interfaces without causing the resulting work to be covered by
-# the GNU General Public License. Only Red Hat, Inc. may make changes or
-# additions to the list of Approved Interfaces. You must obey the GNU General
-# Public License in all respects for all of the Program code and other code used
-# in conjunction with the Program except the Non-GPL Code covered by this
-# exception. If you modify this file, you may extend this exception to your
-# version of the file, but you are not obligated to do so. If you do not wish to
-# provide this exception without modification, you must delete this exception
-# statement from your version and license this file solely under the GPL without
-# exception. 
-# 
-# 
-# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
-# Copyright (C) 2005 Red Hat, Inc.
-# All rights reserved.
-# END COPYRIGHT BLOCK
-#
-# Packaging nmake Makefile for Console.msi
-
-PKGNAME=Console
-BRAND_PKGNAME=389$(PKGNAME)
-PKGDIR=.
-WXSDIR=.
-
-# could also use wget or curl
-DOWNLOAD="c:\program files\support tools\bitsadmin" /wrap /transfer consolebuild /download /priority normal
-SBC=http://filer/components
-SBV=http://filer/components
-
-UNZIP=cscript //nologo unzip.vbs
-
-NSPRVER=4.7.3
-NSSVER=3_12_2
-LDAPJDKVER=4.18
-LDAPJDKVERDIR=4.18/20070817.1
-JSSVER=4_2_5
-JSSVERDIR=JSS_$(JSSVER)_RTM/20090122.1
-IDMVER=1.1
-IDMVERDIR=$(IDMVER)/20090310.1
-WIXVER=2.0.5805.0
-PLAT=WINNT5.0_OPT.OBJ
-
-# where to stage the package layout
-PKGDIR=build.$(PLAT)
-# where to find components to package
-COMPDIR=$(PKGDIR)
-
-# where to find nspr dlls
-NSPRDIR=$(COMPDIR)\nspr
-NSPRLIBDIR=$(NSPRDIR)\lib
-# where to find nss dlls
-NSSDIR=$(COMPDIR)\nss
-NSSLIBDIR=$(NSSDIR)\lib
-# where to find nss exes
-NSSBINDIR=$(NSSDIR)\bin
-# where to find jss jar and dll
-JSSDIR=$(COMPDIR)\jss
-# where to find the ldapjdk.jar
-LDAPDIR=$(COMPDIR)\console
-#LDAPDIR=$(COMPDIR)\ldapjdk-4.18
-# where to find the idm-console-framework jars
-IDMDIR=$(COMPDIR)\console
-# where to find the 389-console jar and other files
-CONSOLEDIR=.
-
-WIXURL=$(SBC)/wix
-WIXDIR=$(COMPDIR)\wix
-CANDLE=$(WIXDIR)\candle.exe
-LIGHT=$(WIXDIR)\light.exe
-
-ALL : $(PKGDIR)\$(BRAND_PKGNAME).msi
-
-$(PKGDIR) :
-	mkdir $@
-	mkdir $@\Bitmaps
-
-$(NSPRDIR) $(NSSDIR) $(JSSDIR) $(LDAPDIR) $(IDMDIR) $(CONSOLEDIR) $(WIXDIR):
-	mkdir $@
-
-$(NSPRDIR)\mdbinary.jar : $(NSPRDIR)
-	if not exist $@ $(DOWNLOAD) $(SBC)/nspr/v$(NSPRVER)/$(PLAT)/$(@F) %%CD%%\$@
-
-$(NSPRLIBDIR)\libnspr4.dll : $(NSPRDIR)\mdbinary.jar
-	$(UNZIP) $? $(?D)
-
-$(NSSDIR)\mdbinary.jar : $(NSSDIR)
-	if not exist $@ $(DOWNLOAD) $(SBC)/nss/NSS_$(NSSVER)_RTM/$(PLAT)/$(@F) %%CD%%\$@
-
-$(NSSLIBDIR)\nss3.dll : $(NSSDIR)\mdbinary.jar
-	$(UNZIP) $? $(?D)
-
-$(JSSDIR)\jss4.dll : $(JSSDIR)
-	if not exist $@ $(DOWNLOAD) $(SBV)/jss/$(JSSVERDIR)/$(PLAT)/lib/$(@F) %%CD%%\$@
-
-$(JSSDIR)\jss4.jar :
-	if not exist $@ $(DOWNLOAD) $(SBV)/jss/$(JSSVERDIR)/$(@F) %%CD%%\$@
-
-$(LDAPDIR)\ldapjdk.jar : $(LDAPDIR)
-	if not exist $@ $(DOWNLOAD) $(SBV)/ldapjdk/$(LDAPJDKVERDIR)/$(@F) %%CD%%\$@
-
-$(IDMDIR)\idm-console-base.jar $(IDMDIR)\idm-console-mcc.jar $(IDMDIR)\idm-console-mcc_en.jar $(IDMDIR)\idm-console-nmclf.jar $(IDMDIR)\idm-console-nmclf_en.jar : $(IDMDIR)
-	if not exist $@ $(DOWNLOAD) $(SBV)/idm-console-framework/$(IDMVERDIR)/$(@F) %%CD%%\$@
-
-$(CONSOLEDIR)\389-console_en.jar : $(CONSOLEDIR)
-	echo where is $@
-
-$(WIXDIR)\wix-$(WIXVER).zip : $(WIXDIR)
-	if not exist $@ $(DOWNLOAD) $(WIXURL)/$(@F) %%CD%%\$@
-
-$(CANDLE) : $(WIXDIR)\wix-$(WIXVER).zip
-	$(UNZIP) $? $(?D)
-
-LAYOUT : $(PKGDIR) $(NSPRLIBDIR)\libnspr4.dll $(NSSLIBDIR)\nss3.dll $(JSSDIR)\jss4.dll $(JSSDIR)\jss4.jar $(LDAPDIR)\ldapjdk.jar $(IDMDIR)\idm-console-base.jar $(IDMDIR)\idm-console-mcc.jar $(IDMDIR)\idm-console-mcc_en.jar $(IDMDIR)\idm-console-nmclf.jar $(IDMDIR)\idm-console-nmclf_en.jar $(CONSOLEDIR)\389-console_en.jar
-	copy /Y $(NSPRLIBDIR)\*.dll $(PKGDIR)
-	copy /Y $(NSSLIBDIR)\*.dll $(PKGDIR)
-	copy /Y $(NSSBINDIR)\certutil.exe $(PKGDIR)
-	copy /Y $(NSSBINDIR)\pk12util.exe $(PKGDIR)
-	copy /Y $(JSSDIR)\jss4.jar $(PKGDIR)
-	copy /Y $(JSSDIR)\jss4.dll $(PKGDIR)
-	copy /Y $(LDAPDIR)\ldapjdk.jar $(PKGDIR)
-	copy /Y $(IDMDIR)\*.jar $(PKGDIR)
-	copy /Y $(CONSOLEDIR)\*.jar $(PKGDIR)
-# directory should already contain the bat file, icon, and bitmaps
-	copy /Y *.bat $(PKGDIR)
-	copy /Y *.ico $(PKGDIR)
-	copy /Y Bitmaps\* $(PKGDIR)\Bitmaps\*
-	copy /Y License.rtf $(PKGDIR)
-
-$(PKGDIR)\$(BRAND_PKGNAME).msi : $(PKGDIR) LAYOUT $(CANDLE) $(PKGNAME).wxs
-	$(CANDLE) -nologo -out $(PKGDIR)\$(PKGNAME).wixobj $(PKGNAME).wxs
-	$(LIGHT) -nologo -out $@ -b $(PKGDIR) $(PKGDIR)\$(PKGNAME).wixobj $(WIXDIR)\wixui.wixlib -loc $(WIXDIR)\WixUI_en-us.wxl
-
-clean:
-	rmdir /S /Q $(PKGDIR)
-
-help:
-	@echo You must define the following paths:
-	@echo BASEDIR - the directory containing all of the other components' directories
-	@echo   e.g. nmake BASEDIR="c:\Documents and Settings\userid"
-	@echo Use
-	@echo   nmake BASEDIR=foo download
-	@echo to download the components from the default filer
-	@echo the download target will create $(PKGDIR) and place the files in there
-	@echo You will have to download the branded console jar file manually
-	@echo Or you may download them separately and specify individual directories:
-	@echo NSPRLIBDIR - directory containing the NSPR dlls
-	@echo NSSLIBDIR - directory containing the NSS dlls
-	@echo NSSBINDIR - directory containing certutil.exe and pk12util.exe
-	@echo JSSDIR - directory containing jss4.jar and jss4.dll
-	@echo LDAPDIR - directory containing ldapjdk.jar
-	@echo IDMDIR - directory containing the IDM Console Framework jar files
-	@echo CONSOLEDIR - directory containing the 389 console jar file
-	@echo WIXDIR - directory containing the WiX candle.exe, light.exe, and library files
-	@echo Type 'nmake NSPRLIBDIR=... NSSLIBDIR=... etc.' to build the Console.msi package
+#
+# BEGIN COPYRIGHT BLOCK
+# This Program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation; version 2 of the License.
+# 
+# This Program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License along with
+# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA.
+# 
+# In addition, as a special exception, Red Hat, Inc. gives You the additional
+# right to link the code of this Program with code not covered under the GNU
+# General Public License ("Non-GPL Code") and to distribute linked combinations
+# including the two, subject to the limitations in this paragraph. Non-GPL Code
+# permitted under this exception must only link to the code of this Program
+# through those well defined interfaces identified in the file named EXCEPTION
+# found in the source code files (the "Approved Interfaces"). The files of
+# Non-GPL Code may instantiate templates or use macros or inline functions from
+# the Approved Interfaces without causing the resulting work to be covered by
+# the GNU General Public License. Only Red Hat, Inc. may make changes or
+# additions to the list of Approved Interfaces. You must obey the GNU General
+# Public License in all respects for all of the Program code and other code used
+# in conjunction with the Program except the Non-GPL Code covered by this
+# exception. If you modify this file, you may extend this exception to your
+# version of the file, but you are not obligated to do so. If you do not wish to
+# provide this exception without modification, you must delete this exception
+# statement from your version and license this file solely under the GPL without
+# exception. 
+# 
+# 
+# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
+# Copyright (C) 2005 Red Hat, Inc.
+# All rights reserved.
+# END COPYRIGHT BLOCK
+#
+# Packaging nmake Makefile for Console.msi
+
+!IF EXIST(VERSION.mak)
+!INCLUDE VERSION.mak
+!ENDIF
+
+PKGDIR=.
+WXSDIR=.
+
+!IF "$(CPU)" == "AMD64"
+FLAG64=_64
+USE64=1
+PLATFORM=x86_64
+MSMPLAT=x64
+!ELSE
+PLATFORM=i386
+MSMPLAT=x86
+!ENDIF
+
+!IF "$(APPVER)" == "6.0"
+WINVER=8.0
+!ELSE
+WINVER=5.2
+!ENDIF
+
+!IF "$(BUILD_DEBUG)" == "optimize"
+OPTDBG=_OPT
+!ELSE
+OPTDBG=_DBG
+!ENDIF
+
+PLAT=WINNT$(WINVER)$(FLAG64)$(OPTDBG).OBJ
+
+FULL_PKGNAME=$(BRANDNOSPACE)-$(PKGNAME)-$(VERSION)-$(PLATFORM).msi
+
+# could also use wget or curl
+!IF EXIST("c:\program files\support tools\bitsadmin.exe")
+BITSADMIN=c:\program files\support tools\bitsadmin.exe
+!ELSE
+BITSADMIN=bitsadmin
+!ENDIF
+DOWNLOAD=$(BITSADMIN) /wrap /transfer consolebuild /download /priority normal
+!IFNDEF SBC
+SBC=http://filer/components
+!ENDIF
+!IFNDEF SBV
+SBV=http://filer/components
+!ENDIF
+
+#UZCMD=cscript //nologo unzip.vbs
+UZCMD=c:\mozilla-build\info-zip\unzip.exe -q -o
+
+NSPRVER=4.8
+NSSVER=3_12_4
+LDAPJDKVER=4.18
+LDAPJDKVERDIR=4.18/20070817.1
+JSSVER=4_2_6
+!IFDEF USE64
+JSSVERDIR=JSS_$(JSSVER)_RTM/20091019.1
+!ELSE
+JSSVERDIR=JSS_$(JSSVER)_RTM/20091020.1
+!ENDIF
+IDMVER=1.1
+IDMVERDIR=$(IDMVER)/20090310.1
+WIXVER=2.0.5805.0
+
+# where to stage the package layout
+PKGDIR=build.$(PLAT)
+# where to find components to package
+COMPDIR=$(PKGDIR)
+
+# where to find nspr dlls
+NSPRDIR=$(COMPDIR)\nspr
+NSPRLIBDIR=$(NSPRDIR)\lib
+# where to find nss dlls
+NSSDIR=$(COMPDIR)\nss
+NSSLIBDIR=$(NSSDIR)\lib
+# where to find nss exes
+NSSBINDIR=$(NSSDIR)\bin
+# where to find jss jar and dll
+JSSDIR=$(COMPDIR)\jss
+# where to find the ldapjdk.jar
+LDAPDIR=$(COMPDIR)\console
+#LDAPDIR=$(COMPDIR)\ldapjdk-4.18
+# where to find the idm-console-framework jars
+IDMDIR=$(COMPDIR)\console
+# where to find the console jar and other files
+CONSOLEDIR=$(COMPDIR)\console
+CONSOLEJARURL=$(SBV)/$(FILEPREF)-console/1.0/20090122.1
+
+WIXURL=$(SBC)/wix
+WIXDIR=$(COMPDIR)\wix
+#CANDLE=$(WIXDIR)\candle.exe
+CANDLE=wix\candle.exe
+LIGHT=$(WIXDIR)\light.exe
+
+ALL : $(PKGDIR)\$(FULL_PKGNAME)
+
+$(PKGDIR) :
+	mkdir $@
+	mkdir $@\Bitmaps
+
+$(NSPRDIR) $(NSSDIR) $(JSSDIR) $(LDAPDIR) $(IDMDIR) $(CONSOLEDIR) $(WIXDIR):
+	mkdir $@
+
+$(NSPRDIR)\mdbinary.jar : $(NSPRDIR)
+	if not exist $@ $(DOWNLOAD) $(SBC)/nspr/v$(NSPRVER)/$(PLAT)/$(@F) %%CD%%\$@
+
+$(NSPRLIBDIR)\libnspr4.dll : $(NSPRDIR)\mdbinary.jar
+	$(UZCMD) $? -d $(?D)
+
+$(NSSDIR)\mdbinary.jar : $(NSSDIR)
+	if not exist $@ $(DOWNLOAD) $(SBC)/nss/NSS_$(NSSVER)_RTM/$(PLAT)/$(@F) %%CD%%\$@
+
+$(NSSLIBDIR)\nss3.dll : $(NSSDIR)\mdbinary.jar
+	$(UZCMD) $? -d $(?D)
+
+$(JSSDIR)\jss4.dll : $(JSSDIR)
+	if not exist $@ $(DOWNLOAD) $(SBV)/jss/$(JSSVERDIR)/$(PLAT)/lib/$(@F) %%CD%%\$@
+
+$(JSSDIR)\jss4.jar :
+	if not exist $@ $(DOWNLOAD) $(SBV)/jss/$(JSSVERDIR)/$(@F) %%CD%%\$@
+
+$(LDAPDIR)\ldapjdk.jar : $(LDAPDIR)
+	if not exist $@ $(DOWNLOAD) $(SBV)/ldapjdk/$(LDAPJDKVERDIR)/$(@F) %%CD%%\$@
+
+$(IDMDIR)\idm-console-base.jar $(IDMDIR)\idm-console-mcc.jar $(IDMDIR)\idm-console-mcc_en.jar $(IDMDIR)\idm-console-nmclf.jar $(IDMDIR)\idm-console-nmclf_en.jar : $(IDMDIR)
+	if not exist $@ $(DOWNLOAD) $(SBV)/idm-console-framework/$(IDMVERDIR)/$(@F) %%CD%%\$@
+
+$(CONSOLEDIR)\$(FILEPREF)-console_en.jar : $(CONSOLEDIR)
+	if not exist $@ $(DOWNLOAD) $(CONSOLEJARURL)/$(@F) %%CD%%\$@
+
+$(WIXDIR)\wix-$(WIXVER).zip : $(WIXDIR)
+	if not exist $@ $(DOWNLOAD) $(WIXURL)/$(@F) %%CD%%\$@
+
+$(CANDLE) : $(WIXDIR)\wix-$(WIXVER).zip
+	$(UZCMD) $? -d $(?D)
+
+LAYOUT : $(PKGDIR) $(NSPRLIBDIR)\libnspr4.dll $(NSSLIBDIR)\nss3.dll $(JSSDIR)\jss4.dll $(JSSDIR)\jss4.jar $(LDAPDIR)\ldapjdk.jar $(IDMDIR)\idm-console-base.jar $(IDMDIR)\idm-console-mcc.jar $(IDMDIR)\idm-console-mcc_en.jar $(IDMDIR)\idm-console-nmclf.jar $(IDMDIR)\idm-console-nmclf_en.jar $(CONSOLEDIR)\$(FILEPREF)-console_en.jar
+	copy /Y $(NSPRLIBDIR)\*.dll $(PKGDIR)
+	copy /Y $(NSSLIBDIR)\*.dll $(PKGDIR)
+	copy /Y $(NSSBINDIR)\certutil.exe $(PKGDIR)
+	copy /Y $(NSSBINDIR)\pk12util.exe $(PKGDIR)
+	copy /Y $(JSSDIR)\jss4.jar $(PKGDIR)
+	copy /Y $(JSSDIR)\jss4.dll $(PKGDIR)
+	copy /Y $(LDAPDIR)\ldapjdk.jar $(PKGDIR)
+	copy /Y $(IDMDIR)\*.jar $(PKGDIR)
+	copy /Y $(CONSOLEDIR)\*.jar $(PKGDIR)
+# directory should already contain the bat file, icon, and bitmaps
+	@(echo @echo off&echo set FILEPREF=$(FILEPREF)) > header
+	copy /Y header+template.bat $(PKGDIR)\$(FILEPREF)-console.bat
+	del header
+	copy /Y $(ICONDIR)\*.ico $(PKGDIR)
+	copy /Y $(BITMAPDIR)\* $(PKGDIR)\Bitmaps\*
+	copy /Y License.rtf $(PKGDIR)
+
+$(PKGDIR)\$(FULL_PKGNAME) : $(PKGDIR) LAYOUT $(PKGDIR)\$(CANDLE) $(PKGNAME).wxs
+	cd $(PKGDIR) & cd & $(CANDLE) -nologo "-dCRTMSM=$(CRTMSM)" "-dPOLICYCRTMSM=$(POLICYCRTMSM)" -dVERSION=$(VERSION) -dUSE64=$(USE64) "-dBRAND=$(BRAND)" -dBRANDNOSPACE=$(BRANDNOSPACE) "-dVENDOR=$(VENDOR)" -dPKGGUID=$(PKGGUID) "-dPRODUCTNAME=$(PRODUCTNAME)" -dFILEPREF=$(FILEPREF) -dUPGRADEGUID=$(UPGRADEGUID) -out $(PKGNAME).wixobj ..\$(PKGNAME).wxs
+	$(LIGHT) -nologo -out $@ -b $(PKGDIR) $(PKGDIR)\$(PKGNAME).wixobj $(WIXDIR)\wixui.wixlib -loc $(WIXDIR)\WixUI_en-us.wxl
+
+clean:
+	rmdir /S /Q $(PKGDIR)
+
+help:
+	@echo You must define the following paths:
+	@echo BASEDIR - the directory containing all of the other components' directories
+	@echo   e.g. nmake BASEDIR="c:\Documents and Settings\userid"
+	@echo Use
+	@echo   nmake BASEDIR=foo download
+	@echo to download the components from the default filer
+	@echo the download target will create $(PKGDIR) and place the files in there
+	@echo You will have to download the branded console jar file manually
+	@echo Or you may download them separately and specify individual directories:
+	@echo NSPRLIBDIR - directory containing the NSPR dlls
+	@echo NSSLIBDIR - directory containing the NSS dlls
+	@echo NSSBINDIR - directory containing certutil.exe and pk12util.exe
+	@echo JSSDIR - directory containing jss4.jar and jss4.dll
+	@echo LDAPDIR - directory containing ldapjdk.jar
+	@echo IDMDIR - directory containing the IDM Console Framework jar files
+	@echo CONSOLEDIR - directory containing the 389 console jar file
+	@echo WIXDIR - directory containing the WiX candle.exe, light.exe, and library files
+	@echo Type 'nmake NSPRLIBDIR=... NSSLIBDIR=... etc.' to build the Console.msi package
diff --git a/win/VERSION.mak b/win/VERSION.mak
new file mode 100644
index 0000000..578c764
--- /dev/null
+++ b/win/VERSION.mak
@@ -0,0 +1,24 @@
+# this is the base name of the msi package
+PKGNAME=Console
+# this is the branding for the package
+BRAND=389
+# this it the brand used in the package filename - no spaces
+BRANDNOSPACE=389
+# this is the vendor or manufacturer
+VENDOR=389 Project
+# the version
+VERSION=1.1.3
+# the name of the product - this is used in the title of the
+# installer, in the name of the folder, and in the name
+# of the shortcuts
+PRODUCTNAME=$(BRAND) Management Console
+# this is the GUID of the package - must be changed
+# when the version is changed - use uuidgen -n1
+PKGGUID=f6570f14-9613-4e40-9e14-450aad257f0e
+# the upgrade GUID should usually not be changed
+UPGRADEGUID=7EA828C0-C219-438d-9BB3-3418DC900D60
+# filename prefix for certain branded jar and script files
+FILEPREF=389
+# location of brand specific bitmaps
+BITMAPDIR=Bitmaps
+ICONDIR=.
\ No newline at end of file
diff --git a/win/build.bat b/win/build.bat
new file mode 100644
index 0000000..7d99ff3
--- /dev/null
+++ b/win/build.bat
@@ -0,0 +1,74 @@
+@rem //
+@rem // BEGIN COPYRIGHT BLOCK
+@rem // This Program is free software; you can redistribute it and/or modify it under
+@rem // the terms of the GNU General Public License as published by the Free Software
+@rem // Foundation; version 2 of the License.
+@rem // 
+@rem // This Program is distributed in the hope that it will be useful, but WITHOUT
+@rem // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+@rem // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+@rem // 
+@rem // You should have received a copy of the GNU General Public License along with
+@rem // this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
+@rem // Place, Suite 330, Boston, MA 02111-1307 USA.
+@rem // 
+@rem // In addition, as a special exception, Red Hat, Inc. gives You the additional
+@rem // right to link the code of this Program with code not covered under the GNU
+@rem // General Public License ("Non-GPL Code") and to distribute linked combinations
+@rem // including the two, subject to the limitations in this paragraph. Non-GPL Code
+@rem // permitted under this exception must only link to the code of this Program
+@rem // through those well defined interfaces identified in the file named EXCEPTION
+@rem // found in the source code files (the "Approved Interfaces"). The files of
+@rem // Non-GPL Code may instantiate templates or use macros or inline functions from
+@rem // the Approved Interfaces without causing the resulting work to be covered by
+@rem // the GNU General Public License. Only Red Hat, Inc. may make changes or
+@rem // additions to the list of Approved Interfaces. You must obey the GNU General
+@rem // Public License in all respects for all of the Program code and other code used
+@rem // in conjunction with the Program except the Non-GPL Code covered by this
+@rem // exception. If you modify this file, you may extend this exception to your
+@rem // version of the file, but you are not obligated to do so. If you do not wish to
+@rem // provide this exception without modification, you must delete this exception
+@rem // statement from your version and license this file solely under the GPL without
+@rem // exception. 
+@rem // 
+@rem // 
+@rem // Copyright (C) 2005 Red Hat, Inc.
+@rem // All rights reserved.
+@rem // END COPYRIGHT BLOCK
+@rem //
+
+@echo off
+
+if [%CPU%] == [AMD64] (
+  set MSMPLAT=x64
+) else (
+  set MSMPLAT=x86
+)
+
+REM Look for the merge module containing the redistributable
+REM runtime for our platform
+
+REM on 64-bit platforms
+for %%i in ("%COMMONPROGRAMFILES(X86)%\Merge Modules\"Microsoft_*_CRT_*%MSMPLAT%.msm) do set CRTMSM="%%i"
+for %%i in ("%COMMONPROGRAMFILES(X86)%\Merge Modules\"policy_*Microsoft_*_CRT_*%MSMPLAT%.msm) do set POLICYCRTMSM="%%i"
+
+REM on 32-bit platforms
+for %%i in ("%COMMONPROGRAMFILES%\Merge Modules\"Microsoft_*_CRT_*%MSMPLAT%.msm) do set CRTMSM="%%i"
+for %%i in ("%COMMONPROGRAMFILES%\Merge Modules\"policy_*Microsoft_*_CRT_*%MSMPLAT%.msm) do set POLICYCRTMSM="%%i"
+
+if not defined CRTMSM (
+   if not ["%MSSDK%"] == [] (
+      set CRTMSM="%MSSDK%"\Redist\VC\microsoft.vcxx.crt.%MSMPLAT%_msm.msm
+      set POLICYCRTMSM="%MSSDK%"\Redist\VC\policy.x.xx.microsoft.vcxx.crt.%MSMPLAT%_msm.msm
+   )
+)
+
+if not defined CRTMSM (
+   echo ERROR: could not find the merge modules for the Visual C++
+   echo runtime side by side assemblies - they should be provided
+   echo with the Visual Studio C++ and/or the Windows SDK
+   echo cannot continue
+   exit 1
+)
+
+nmake /nologo CRTMSM=%CRTMSM% POLICYCRTMSM=%POLICYCRTMSM%
diff --git a/win/fedora-idm-console.bat b/win/fedora-idm-console.bat
deleted file mode 100755
index c99bad2..0000000
--- a/win/fedora-idm-console.bat
+++ /dev/null
@@ -1,79 +0,0 @@
-echo off
-rem BEGIN COPYRIGHT BLOCK
-rem Copyright (C) 2005 Red Hat, Inc.
-rem All rights reserved.
-rem
-rem This library is free software; you can redistribute it and/or
-rem modify it under the terms of the GNU Lesser General Public
-rem License as published by the Free Software Foundation version
-rem 2.1 of the License.
-rem                                                                                 
-rem This library is distributed in the hope that it will be useful,
-rem but WITHOUT ANY WARRANTY; without even the implied warranty of
-rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-rem Lesser General Public License for more details.
-rem                                                                                 
-rem You should have received a copy of the GNU Lesser General Public
-rem License along with this library; if not, write to the Free Software
-rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-rem END COPYRIGHT BLOCK
-
-rem set the JAVA to use here
-rem set JAVA=C:\j2sdk1.4.2_15\bin\java
-
-if not "%JAVA%foo"=="foo" goto launch
-
-java -version > nul 2>&1 || goto findjre
-
-set JAVA=java
-goto launch
-
-:findjre
-rem look for Java Runtime Environment in registry
-reg QUERY "HKLM\SOFTWARE\JavaSoft\Java Runtime Environment" > nul 2>&1 || goto findjdk
-
-rem can we grab the java location from the registry?
-rem set JAVA=path\bin\java
-rem apparently not, in a batch file
-rem goto launch
-echo The Java Runtime Environment is installed on this machine, but the
-echo command java.exe is not in your PATH.  You can either make sure java.exe
-echo is in the PATH, or edit this script to set JAVA to the full path of
-echo java.exe
-pause
-goto end
-
-:findjdk
-reg QUERY "HKLM\SOFTWARE\JavaSoft\Java Development Kit" > nul 2>&1 || goto nojava
-
-rem can we grab the java location from the registry?
-rem set JAVA=path\bin\java
-rem goto launch
-echo The Java Development Kit is installed on this machine, but the
-echo command java.exe is not in your PATH.  You can either make sure java.exe
-echo is in the PATH, or edit this script to set JAVA to the full path of
-echo java.exe
-pause
-goto end
-
-:nojava
-echo Java does not appear to be installed on this machine.  Please download and install the Java Runtime Environment and make sure the java.exe command is in the PATH of this command.
-pause
-goto end
-
-:launch
-set BASEPATH=.
-set FIDMCONSOLEJARDIR=%BASEPATH%
-set CONSOLEJARDIR=%BASEPATH%
-set JSSDIR=%BASEPATH%
-set LDAPJARDIR=%BASEPATH%
-
-set PATH=%BASEPATH%;%PATH%
-
-rem
-rem Launch the Console
-rem
-echo on
-"%JAVA%" "-Djava.library.path=%JSSDIR%" -cp "%JSSDIR%/jss4.jar;%LDAPJARDIR%/ldapjdk.jar;%CONSOLEJARDIR%/idm-console-base.jar;%CONSOLEJARDIR%/idm-console-mcc.jar;%CONSOLEJARDIR%/idm-console-mcc_en.jar;%CONSOLEJARDIR%/idm-console-nmclf.jar;%CONSOLEJARDIR%/idm-console-nmclf_en.jar;%FIDMCONSOLEJARDIR%/fedora-idm-console_en.jar" -Djava.util.prefs.systemRoot=%HOME%/.fedora-idm-console -Djava.util.prefs.userRoot=%HOME%/.fedora-idm-console com.netscape.management.client.console.Console %*
-
-:end
diff --git a/win/template.bat b/win/template.bat
new file mode 100644
index 0000000..df28dfb
--- /dev/null
+++ b/win/template.bat
@@ -0,0 +1,79 @@
+echo off
+rem BEGIN COPYRIGHT BLOCK
+rem Copyright (C) 2005 Red Hat, Inc.
+rem All rights reserved.
+rem
+rem This library is free software; you can redistribute it and/or
+rem modify it under the terms of the GNU Lesser General Public
+rem License as published by the Free Software Foundation version
+rem 2.1 of the License.
+rem                                                                                 
+rem This library is distributed in the hope that it will be useful,
+rem but WITHOUT ANY WARRANTY; without even the implied warranty of
+rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+rem Lesser General Public License for more details.
+rem                                                                                 
+rem You should have received a copy of the GNU Lesser General Public
+rem License along with this library; if not, write to the Free Software
+rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+rem END COPYRIGHT BLOCK
+
+rem set the JAVA to use here
+rem set JAVA=C:\j2sdk1.4.2_15\bin\java
+
+if not "%JAVA%foo"=="foo" goto launch
+
+java -version > nul 2>&1 || goto findjre
+
+set JAVA=java
+goto launch
+
+:findjre
+rem look for Java Runtime Environment in registry
+reg QUERY "HKLM\SOFTWARE\JavaSoft\Java Runtime Environment" > nul 2>&1 || goto findjdk
+
+rem can we grab the java location from the registry?
+rem set JAVA=path\bin\java
+rem apparently not, in a batch file
+rem goto launch
+echo The Java Runtime Environment is installed on this machine, but the
+echo command java.exe is not in your PATH.  You can either make sure java.exe
+echo is in the PATH, or edit this script to set JAVA to the full path of
+echo java.exe
+pause
+goto end
+
+:findjdk
+reg QUERY "HKLM\SOFTWARE\JavaSoft\Java Development Kit" > nul 2>&1 || goto nojava
+
+rem can we grab the java location from the registry?
+rem set JAVA=path\bin\java
+rem goto launch
+echo The Java Development Kit is installed on this machine, but the
+echo command java.exe is not in your PATH.  You can either make sure java.exe
+echo is in the PATH, or edit this script to set JAVA to the full path of
+echo java.exe
+pause
+goto end
+
+:nojava
+echo Java does not appear to be installed on this machine.  Please download and install the Java Runtime Environment and make sure the java.exe command is in the PATH of this command.
+pause
+goto end
+
+:launch
+set BASEPATH=.
+set BRANDCONSOLEJARDIR=%BASEPATH%
+set CONSOLEJARDIR=%BASEPATH%
+set JSSDIR=%BASEPATH%
+set LDAPJARDIR=%BASEPATH%
+
+set PATH=%BASEPATH%;%PATH%
+
+rem
+rem Launch the Console
+rem
+echo on
+"%JAVA%" "-Djava.library.path=%JSSDIR%" -cp "%JSSDIR%/jss4.jar;%LDAPJARDIR%/ldapjdk.jar;%CONSOLEJARDIR%/idm-console-base.jar;%CONSOLEJARDIR%/idm-console-mcc.jar;%CONSOLEJARDIR%/idm-console-mcc_en.jar;%CONSOLEJARDIR%/idm-console-nmclf.jar;%CONSOLEJARDIR%/idm-console-nmclf_en.jar;%BRANDCONSOLEJARDIR%/%FILEPREF%-console_en.jar" -Djava.util.prefs.systemRoot=%HOME%/.%FILEPREF%-console -Djava.util.prefs.userRoot=%HOME%/.%FILEPREF%-console com.netscape.management.client.console.Console %*
+
+:end
diff --git a/win/unzip.vbs b/win/unzip.vbs
index 8254624..d80a1a6 100644
--- a/win/unzip.vbs
+++ b/win/unzip.vbs
@@ -1,71 +1,71 @@
-' unzip a zip file
-
-Sub Usage()
-    WScript.Echo "Usage: cscript unzip.vbs \path\to\file.zip [destinationfolder]"
-    WScript.Echo "Example: cscript unzip.vbs ..\src\foo.zip ..\dest"
-    WScript.Echo "NOTE: The .zip file must have a .zip extension, so if"
-    WScript.Echo "it does not, a temporary copy will be made with a .zip extension"
-    WScript.Echo "If the destinationfolder does not exist, it will be created"
-    WScript.Echo "Use '.' for the current directory"
-    WScript.Echo "If the destinationfolder is not specified, '.' will be used"
-End Sub
-
-' see if args are correct
-Set objArgs = WScript.Arguments
-If objArgs.Count < 1 then
-   Usage
-   WScript.Quit(1)
-End If
-
-' get our FSO object
-Set objFSO = CreateObject("Scripting.FileSystemObject")
-' src zip file is arg 0
-SRC = objFSO.GetAbsolutePathName(objArgs(0))
-' dest folder is arg 1 or "."
-If objArgs.Count < 2 then
-   DEST = objFSO.GetAbsolutePathName(".")
-Else
-   DEST = objFSO.GetAbsolutePathName(objArgs(1))
-End If
-' debugging - print args
-' For I = 0 to objArgs.Count - 1
-'    WScript.Echo "arg ", I, " ", objArgs(I)
-' Next
-
-' create dest folder if it does not exist
-If not objFSO.FolderExists(DEST) Then
-    objFSO.CreateFolder(DEST)
-    WScript.Echo "Created new folder", DEST
-End If
-
-' see if file ends in .zip - if not (e.g. .jar) make temp copy
-' that ends in .zip
-Dim newSRC
-newSRC = ""
-If not Right(SRC, 4) = ".zip" Then
-    newSRC = SRC & ".zip"
-    objFSO.CopyFile SRC, newSRC, true
-    SRC = newSRC
-End If
-
-' get the shell application object used to do the unzip
-Set objShell = CreateObject("Shell.Application")
-Set objSrc = objShell.Namespace(SRC)
-Set objDest = objShell.Namespace(DEST)
-' For Each item in objSrc.Items
-'     WScript.Echo "item = ", item
-' Next
-objDest.CopyHere(objSrc.Items)
-
-' remove temp zip, if any
-If Len(newSrc) > 0 Then
-    objFSO.DeleteFile(newSRC)
-End If
-
-WScript.Stdout.Write "Done.  Copied contents of " & SRC & " to " & DEST
-
-' Set WshShell = WScript.CreateObject("WScript.Shell")
-' WScript.Echo "CD =", WshShell.CurrentDirectory
-
-' Set objFolder = objFSO.GetFolder(".")
-' WScript.Echo "name = ", objFolder.Name
+' unzip a zip file
+
+Sub Usage()
+    WScript.Echo "Usage: cscript unzip.vbs \path\to\file.zip [destinationfolder]"
+    WScript.Echo "Example: cscript unzip.vbs ..\src\foo.zip ..\dest"
+    WScript.Echo "NOTE: The .zip file must have a .zip extension, so if"
+    WScript.Echo "it does not, a temporary copy will be made with a .zip extension"
+    WScript.Echo "If the destinationfolder does not exist, it will be created"
+    WScript.Echo "Use '.' for the current directory"
+    WScript.Echo "If the destinationfolder is not specified, '.' will be used"
+End Sub
+
+' see if args are correct
+Set objArgs = WScript.Arguments
+If objArgs.Count < 1 then
+   Usage
+   WScript.Quit(1)
+End If
+
+' get our FSO object
+Set objFSO = CreateObject("Scripting.FileSystemObject")
+' src zip file is arg 0
+SRC = objFSO.GetAbsolutePathName(objArgs(0))
+' dest folder is arg 1 or "."
+If objArgs.Count < 2 then
+   DEST = objFSO.GetAbsolutePathName(".")
+Else
+   DEST = objFSO.GetAbsolutePathName(objArgs(1))
+End If
+' debugging - print args
+' For I = 0 to objArgs.Count - 1
+'    WScript.Echo "arg ", I, " ", objArgs(I)
+' Next
+
+' create dest folder if it does not exist
+If not objFSO.FolderExists(DEST) Then
+    objFSO.CreateFolder(DEST)
+    WScript.Echo "Created new folder", DEST
+End If
+
+' see if file ends in .zip - if not (e.g. .jar) make temp copy
+' that ends in .zip
+Dim newSRC
+newSRC = ""
+If not Right(SRC, 4) = ".zip" Then
+    newSRC = SRC & ".zip"
+    objFSO.CopyFile SRC, newSRC, true
+    SRC = newSRC
+End If
+
+' get the shell application object used to do the unzip
+Set objShell = CreateObject("Shell.Application")
+Set objSrc = objShell.Namespace(SRC)
+Set objDest = objShell.Namespace(DEST)
+' For Each item in objSrc.Items
+'     WScript.Echo "item = ", item
+' Next
+objDest.CopyHere(objSrc.Items)
+
+' remove temp zip, if any
+If Len(newSrc) > 0 Then
+    objFSO.DeleteFile(newSRC)
+End If
+
+WScript.Stdout.Write "Done.  Copied contents of " & SRC & " to " & DEST
+
+' Set WshShell = WScript.CreateObject("WScript.Shell")
+' WScript.Echo "CD =", WshShell.CurrentDirectory
+
+' Set objFolder = objFSO.GetFolder(".")
+' WScript.Echo "name = ", objFolder.Name
-- 
1.5.6.1.1071.g76fb

