Windows installer for mech_eap
authorKevin Wasserman <krwasserman@painless-security.com>
Tue, 14 Apr 2015 19:59:25 +0000 (15:59 -0400)
committerKevin Wasserman <krwasserman@hotmail.com>
Tue, 14 Apr 2015 20:12:52 +0000 (16:12 -0400)
Makefile.am
configure.ac
windows/app.wxs [new file with mode: 0644]
windows/win-vc-env.cmd

index 0165219..3fca34b 100644 (file)
@@ -2,3 +2,9 @@ AUTOMAKE_OPTIONS = foreign
 ACLOCAL_AMFLAGS = -I m4
 SUBDIRS = libeap mech_eap
 EXTRA_DIST = mech_eap.spec
+
+if TARGET_WINDOWS
+mech_eap.msi: windows/app.wxs windows/config.wxi mech_eap/mech_eap.dll
+       "${WIX_CANDLE}" $<
+       "${WIX_LIGHT}" -b "${WINDIR}\system32" -b "${MSVCREDIST}" -b "${KRB5DIR}bin" -b /mingw -o mech_eap.msi app.wixobj
+endif
\ No newline at end of file
index fabdb9c..5811f92 100644 (file)
@@ -76,6 +76,23 @@ AX_CHECK_KRB5
 AX_CHECK_OPENSAML
 AM_CONDITIONAL(OPENSAML, test "x_$check_opensaml_dir" != "x_no")
 
+if test "x$target_windows" = "xyes"; then
+  # Windows Installer XML tools
+  AC_PATH_PROG([WIX_CANDLE], [candle], no,
+               [/c/Program\ Files/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR/c/Program\ Files\ \(x86\)/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR$PATH])
+  AC_PATH_PROG([WIX_LIGHT], [light], no,
+               [/c/Program\ Files/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR/c/Program\ Files\ \(x86\)/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR$PATH])
+  AC_PATH_PROG([WIX_LIT], [lit], no,
+               [/c/Program\ Files/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR/c/Program\ Files\ \(x86\)/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR$PATH])
+
+  if test "$WIX_CANDLE" = "no" || test "$WIX_LIGHT" = "no" || test "$WIX_LIT" = "no"; then
+     AC_MSG_WARN([
+*** Could not find the Windows Installer XML tools. These are required
+*** for the 'make installer' target. Use the WIX_CANDLE, WIX_LIGHT,and
+*** WIX_LIT environment variables to pass their locations if they are
+*** outside the PATH.])
+  fi
+fi
 AX_CHECK_SHIBRESOLVER
 AM_CONDITIONAL(SHIBRESOLVER, test "x_$check_shibresolver_dir" != "x_no")
 if test x_$found_shibresolver = x_yes; then
@@ -92,4 +109,8 @@ fi
 AX_CHECK_LIBMOONSHOT
 AC_CONFIG_FILES([Makefile libeap/Makefile mech_eap/Makefile
                          mech_eap.spec])
+
+AC_SUBST(WIX_CANDLE)
+AC_SUBST(WIX_LIGHT)
+
 AC_OUTPUT
diff --git a/windows/app.wxs b/windows/app.wxs
new file mode 100644 (file)
index 0000000..eae10d7
--- /dev/null
@@ -0,0 +1,98 @@
+<?xml version='1.0'?>
+<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
+  <?include .\config.wxi ?>
+
+  <Product Id='$(var.ProductGuid)'
+           Language='1033'
+           Manufacturer='$(var.Manufacturer)'
+           Name='$(var.ProductName)'
+           Version='$(var.ProductVersion)'
+           UpgradeCode='$(var.UpgradeGuid)'>
+
+    <Package Id="*"
+             Description='$(var.PackageDescription)'
+             Keywords='$(var.PackageKeywords)'
+             Manufacturer='$(var.Manufacturer)'
+             Platform='$(var.PackagePlatform)'
+             InstallerVersion='200'
+             Compressed='yes' />
+
+    <Media Id='1' Cabinet='app.cab' EmbedCab='yes' />
+
+    <Directory Id='TARGETDIR' Name='SourceDir'>
+      <Directory Id='ProgramFilesFolder' Name='PFiles'>
+        <Directory Id='INSTALLDIR' Name='MechEap'>
+          <Directory Id='BINDIR' Name='bin'>
+            <!-- General deps -->
+            <Component Id='MsvcDeps' Guid='CC4F44BF-F3AA-4849-9BD9-63F05512C0FD'>
+              <File Id="MSVCRT.DLL" Name="msvcrt.dll" Source="msvcrt.dll" />
+              <File Id="MSVCR100.DLL" Name="msvcr100.dll" Source="msvcr100.dll" />
+            </Component>
+
+            <Component Id='Deps' Guid='4668773A-2486-4BF5-9AFE-A6595F1A3EB9'>
+              <File Id="MSRPC_MINGW.DLL" Name="msrpc-mingw.dll" Source="bin\msrpc-mingw.dll" />
+              <File Id="LIBMOONSHOT_1.DLL" Name="libmoonshot-1.dll" Source="../windows-ui/libmoonshot/.libs/libmoonshot-1.dll" />
+              <File Id="LIBGCC_S_DW2_1.DLL" Name="libgcc_s_dw2-1.dll" Source="bin\libgcc_s_dw2-1.dll" />
+            </Component>
+
+            <!--- KRB5 deps -->
+            <Component Id="Krb5Deps" Guid="31D31EB4-F0DE-4DD9-A91B-1631C30A4D0D">
+              <File Id='GssClient'
+                    Name='gss-client.exe'
+                    DiskId='1'
+                    Source='gss-client.exe'
+                    KeyPath='yes'>
+              </File>
+              <File Id="COMERR32.dll" Name="comerr32.dll" Source="comerr32.dll" />
+              <File Id="GSSAPI32.dll" Name="gssapi32.dll" Source="gssapi32.dll" />
+              <File Id="K5SPRT32.dll" Name="k5sprt32.dll" Source="k5sprt32.dll" />
+              <File Id="KRB5_32.dll" Name="krb5_32.dll" Source="krb5_32.dll" />
+              <File Id="KRBCC32.dll" Name="krbcc32.dll" Source="krbcc32.dll" />
+              <File Id="WSHELP32.dll" Name="wshelp32.dll" Source="wshelp32.dll" />
+            </Component>
+
+            <!-- Gtk+ runtime - /bin -->
+            <Component Id='MechEap' Guid='*'>
+              <File Id="MECHEAP.DLL" Name="mech_eap.dll" Source="mech_eap\mech_eap.dll" />
+            </Component>
+          </Directory>
+
+        </Directory>
+      </Directory>
+      
+      <Directory Id='ProgramMenuFolder' Name='Programs'>
+        <Directory Id='ProgramMenuDir' Name='$(var.ProductName)'>
+          <Component Id='ProgramMenuDir' Guid='$(var.ProgramMenuDirGuid)'>
+            <RemoveFolder Id='ProgramMenuDir' On='uninstall' />
+            <RegistryValue Root='HKCU' Key='Software\MechEap' Type='string' Value='' KeyPath='yes' />
+          </Component>
+        </Directory>
+      </Directory>
+
+
+      <Component Id='RegistryEntries' Guid='*'>
+        <RegistryKey Root='HKLM'
+                     Key='Software\gss\mech\eap-aes128'
+                     Action='createAndRemoveOnUninstall'>
+          <RegistryValue Name='Shared Library' Type="string" Value="[BINDIR]/mech_eap.dll" />
+          <RegistryValue Name='OID' Type="string" Value="1.3.6.1.5.5.15.1.1.17" />
+        </RegistryKey>
+        <RegistryKey Root='HKLM'
+                     Key='Software\gss\mech\eap-aes256'
+                     Action='createAndRemoveOnUninstall'>
+          <RegistryValue Name='Shared Library' Type="string" Value="[BINDIR]/mech_eap.dll" />
+          <RegistryValue Name='OID' Type="string" Value="1.3.6.1.5.5.15.1.1.18" />
+        </RegistryKey>
+      </Component>
+    </Directory>
+
+    <Feature Id='Complete' Level='1'>
+      <ComponentRef Id='Deps' />
+      <ComponentRef Id='MechEap' />
+      <ComponentRef Id='Krb5Deps' />
+      <ComponentRef Id='MsvcDeps' />
+      <ComponentRef Id='ProgramMenuDir' />
+      <ComponentRef Id='RegistryEntries' />
+    </Feature>
+  </Product>
+</Wix>
index 2a8499d..3f9ab09 100644 (file)
@@ -1,2 +1,4 @@
 set PATH=c:\mingw\msys\1.0\local\bin;c:\mingw\msys\1.0\bin;%PATH%;c:\mingw\bin
+for /f "tokens=2,*" %%a in ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0" /v InstallDir') do set "MSVCREDIST=%%~bVC\redist\x64\Microsoft.VC100.CRT"
+for /f "tokens=2,*" %%a in ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MIT\Kerberos" /v InstallDir') do set "KRB5DIR=%%~b"
 call setenv /x86 /Debug