Windows: Support building a lite-client installer
authorAsanka Herath <asanka@secure-endpoints.com>
Fri, 4 Jun 2010 03:58:42 +0000 (23:58 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Fri, 4 Jun 2010 05:09:22 +0000 (22:09 -0700)
If LITECLIENT is defined when invoking the WiX based MSI installer
build, we will build a light-weight client installer MSI.  This
minimizes the size of the installer for users who only need client
functionality from OpenAFS.

The light-weight client excludes:

  - Server components
  - Control center components
  - Administration utilities
  - Debug symbols

Lite-client installer can also be built by invoking target wix-lite
from the root NTMakefile.

Change-Id: I544cdb7170d17358eb235f3c476c468dbae62776
Reviewed-on: http://gerrit.openafs.org/2034
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

NTMakefile
src/NTMakefile
src/WINNT/install/wix/NTMakefile
src/WINNT/install/wix/config.wxi
src/WINNT/install/wix/feature.wxi
src/WINNT/install/wix/files.wxi
src/WINNT/install/wix/registry.wxi

index dd6e1df..36872be 100644 (file)
@@ -713,10 +713,18 @@ wix: loopback man-pages documentation
    $(NTMAKE)
    $(CD) ..\..\..\..
 
+wix-lite: loopback man-pages documentation
+   @echo ***** Making Wix MSI Installer (Lite)
+   $(DOCD) $(SRC)\WINNT\install\wix
+   $(CD) $(SRC)\WINNT\install\wix
+   $(NTMAKE) LITECLIENT=1
+   $(CD) ..\..\..\..
+
 media: install NSIS wix
 
 install-nsis: install NSIS
 
 install-wix: install wix
 
+install-wix-lite: install wix-lite
 
index a7d7042..579000f 100644 (file)
@@ -713,10 +713,18 @@ wix: loopback man-pages documentation
    $(NTMAKE)
    $(CD) ..\..\..\..
 
+wix-lite: loopback man-pages documentation
+   @echo ***** Making Wix MSI Installer (Lite)
+   $(DOCD) $(SRC)\WINNT\install\wix
+   $(CD) $(SRC)\WINNT\install\wix
+   $(NTMAKE) LITECLIENT=1
+   $(CD) ..\..\..\..
+
 media: install NSIS wix
 
 install-nsis: install NSIS
 
 install-wix: install wix
 
+install-wix-lite: install wix-lite
 
index 8fa8b7f..0212c15 100644 (file)
@@ -12,9 +12,15 @@ RELDIR=WINNT\install\wix
 MEDIADIR = $(DESTDIR)\WinInstall
 MEDIABINDIR = $(MEDIADIR)\Dll
 
-MSIFILE = $(MEDIADIR)\openafs-$(LANG).msi
+!IFDEF LITECLIENT
+LITE=-lite
+!ELSE
+LITE=
+!ENDIF
+
+MSIFILE = $(MEDIADIR)\openafs-$(LANG)$(LITE).msi
 !IF ("$(CPU)" == "i386")
-BINMSIFILE = $(MEDIADIR)\openafs-32bit-tools-$(LANG).msi
+BINMSIFILE = $(MEDIADIR)\openafs-32bit-tools-$(LANG)$(LITE).msi
 !ENDIF
 
 !IFNDEF MSIDNNLS
@@ -31,9 +37,9 @@ WIXINCLUDES = \
        registry.wxi \
        lang\$(LANG)\ui.wxi
 
-WIXOBJ = $(OUT)\openafs-$(LANG).wixobj
+WIXOBJ = $(OUT)\openafs-$(LANG)$(LITE).wixobj
 !IF ("$(CPU)" == "i386")
-BINWIXOBJ  = $(OUT)\openafs-32bit-tools-$(LANG).wixobj
+BINWIXOBJ  = $(OUT)\openafs-32bit-tools-$(LANG)$(LITE).wixobj
 !ENDIF
 !IFNDEF NOCYGWIN
 WIXCYGOPT=-dCygwinArchives
@@ -53,9 +59,16 @@ languages:
 #      )
        $(MAKE) /f NTMakefile /nologo LANG=en_US lang
 
-
 lang:: lang_clean $(MSIFILE) $(BINMSIFILE)
 
+lang_clean:
+       -$(DEL) $(WIXOBJ)
+       -$(DEL) $(MSIFILE)
+!IF ("$(CPU)" == "i386")
+       -$(DEL) $(BINWIXOBJ)
+       -$(DEL) $(BINMSIFILE)
+!ENDIF
+
 uninst: 
         $(CD) uninstall
         $(MAKE) /f NTMakefile /nologo install
@@ -86,6 +99,9 @@ $(WIXOBJ): openafs.wxs $(WIXINCLUDES)
                "-dDestDir=$(DESTDIR)\\" \
                -dCellDbFile=CellServDB \
                "-dIDNMRedistDir=$(MSIDNNLS)\\REDIST"   \
+!IFDEF LITECLIENT
+               -dLiteClient=1 \
+!ENDIF
                -v0 \
                -w0 \
                $(WIXCYGOPT) $(AFSDEV_AUXWIXDEFINES)    openafs.wxs
@@ -101,6 +117,9 @@ $(BINWIXOBJ): oafwbins.wxs $(WIXINCLUDES)
                -dVersionPatch=$(AFSPRODUCT_VER_PATCH)  \
                "-dDestDir=$(DESTDIR)\\" \
                -dCellDbFile=CellServDB \
+!IFDEF LITECLIENT
+               -dLiteClient=1 \
+!ENDIF
                -v0 \
                -w0 \
         $(WIXCYGOPT) $(AFSDEV_AUXWIXDEFINES)   oafwbins.wxs
@@ -113,6 +132,12 @@ $(BINMSIFILE): $(BINWIXOBJ)
        dir $(BINMSIFILE)
 !ENDIF
 
+# Pseudotarget for building lite installer.
+!IFNDEF LITECLIENT
+lite:
+       $(MAKE) /f NTMakefile /nologo install LITECLIENT=1
+!ENDIF
+
 # Cleanup
 clean::
        for %l in ( $(LANGUAGES) ) do \
@@ -124,13 +149,5 @@ clean::
        $(MAKE) /f NTMakefile /nologo clean
        $(CD) ..
 
-lang_clean:
-       -$(DEL) $(WIXOBJ)
-       -$(DEL) $(MSIFILE)
-!IF ("$(CPU)" == "i386")
-       -$(DEL) $(BINWIXOBJ)
-       -$(DEL) $(BINMSIFILE)
-!ENDIF
-
 
 
index bf4da81..7e04296 100644 (file)
         <?error AFSDEV_BUILDTYPE is not set in the environment.?>
     <?endif?>
 
-    <!-- We are including debug symbols anyway.  Undefine this for a leaner installer without debug syms. -->
-    <?define DebugSyms = "yes"?>
+    <!-- Are we building a lite installer? then don't include debug symbols -->
+    <?ifdef LiteClient ?>
+        <?define NoDebugSyms ?>
+    <?endif?>
+
+    <!-- Default to including debug symbols unless someone defines
+         NoDebugSyms. -->
+    <?ifndef NoDebugSyms ?>
+        <?define DebugSyms = "yes"?>
+    <?endif?>
 
     <!-- Parameters for the features containing debug symbols -->
     <?ifdef DebugSyms?>
index da42ec2..036065a 100644 (file)
                 <!-- Runtime -->
                 <?include runtime.wxi?>
             </Feature>
-            
+
+            <?ifndef LiteClient ?>
             <Feature Id="feaServer" AllowAdvertise="no" Description="$(loc.StrAFSServerLongDesc)" Display="expand"
                 InstallDefault="followParent" Level="130" Title="$(loc.StrAFSServerDesc)">
 
                                        <?include runtime_debug.wxi?>
                 </Feature>
             <?endif?>
-
                 <!-- Runtime -->
                 <?include runtime.wxi?>
             </Feature>
+            <?endif?>
+            <?ifndef LiteClient ?>
             <Feature Id="feaControlCenter" AllowAdvertise="no" Description="$(loc.StrAFSCCLongDesc)"
                 Display="expand" InstallDefault="followParent" Level="130" Title="$(loc.StrAFSCCDesc)">
                 
                 <!-- Runtime -->
                 <?include runtime.wxi?>
             </Feature>
+            <?endif?>
+            <?ifndef LiteClient ?>
             <Feature Id="feaSDK" AllowAdvertise="no" Description="$(loc.StrAFSSDKLongDesc)" Display="expand"
                 InstallDefault="followParent" Level="130" Title="$(loc.StrAFSSDKDesc)">
 
                 <!-- Runtime -->
                 <?include runtime.wxi?>
             </Feature>
+            <?endif?>
             
             <Feature Id="feaDocumentation" AllowAdvertise="no" Description="$(loc.StrAFSDocLongDesc)"
                 Display="expand" InstallDefault="followParent" Level="130" Title="$(loc.StrAFSDocDesc)">
index 8e0a434..4862d36 100644 (file)
@@ -31,6 +31,7 @@
                     <File Id="fileafsvosadmin_DLL" Name="afsvosad.dll" LongName="afsvosadmin.dll" KeyPath="yes" DiskId="1" src="$(var.ServerDir)\afsvosadmin.dll"/>
                 </Component>
   <?ifndef BinsOnly?>
+  <?ifndef LiteClient?>
                 <Component Win64="$(var.Win64)" Id="cmf_afsbosadmin_DLL" Guid="$(var.cmf_afsbosadmin_DLL_guid)">
                     <File Id="fileafsbosadmin_DLL" Name="afsbosad.dll" LongName="afsbosadmin.dll" KeyPath="yes" DiskId="1" src="$(var.ServerDir)\afsbosadmin.dll"/>
                 </Component>
@@ -44,6 +45,7 @@
                     <File Id="fileafsptsadmin_DLL" Name="afsptsad.dll" LongName="afsptsadmin.dll" KeyPath="yes" DiskId="1" src="$(var.ServerDir)\afsptsadmin.dll"/>
                 </Component>
   <?endif?>
+  <?endif?>
 
                 <Component Win64="$(var.Win64)" Id="cmf_afsrpc_DLL" Guid="$(var.cmf_afsrpc_DLL_guid)">
                     <File Id="fileafsrpc_DLL" Name="afsrpc.dll" LongName="afsrpc.dll" KeyPath="yes" DiskId="1" src="$(var.LibDir)\afsrpc.dll"/>
   <?ifndef BinsOnly ?>
                 <!-- <<LanguageSpecific:1033/en_US>> -->
             <?if $(var.Language) ="en_US"?>
+            <?ifndef LiteClient?>
                 <Component Win64="$(var.Win64)" Id="cmf_afseventmsg_1033_DLL" Guid="$(var.cmf_afseventmsg_1033_DLL_guid)">
                     <File Id="fileafseventmsg_1033_DLL" Name="afse1033.dll" LongName="afseventmsg_1033.dll" KeyPath="yes" DiskId="1" src="$(var.ServerDir)\afseventmsg_1033.dll"/>
                 </Component>
                 <Component Win64="$(var.Win64)" Id="cmf_TaAfsAccountManager_1033_DLL" Guid="$(var.cmf_TaAfsAccountManager_1033_DLL_guid)">
                     <File Id="fileTaAfsAccountManager_1033_DLL" Name="tacm1033.dll" LongName="TaAfsAccountManager_1033.dll" KeyPath="yes" DiskId="1" src="$(var.ServerDir)\TaAfsAccountManager_1033.dll"/>
                 </Component>
-                <Component Win64="$(var.Win64)" Id="cmf_TaAfsAppLib_1033_DLL" Guid="$(var.cmf_TaAfsAppLib_1033_DLL_guid)">
-                    <File Id="fileTaAfsAppLib_1033_DLL" Name="taal1033.dll" LongName="TaAfsAppLib_1033.dll" KeyPath="yes" DiskId="1" src="$(var.ServerDir)\TaAfsAppLib_1033.dll"/>
-                </Component>
                 <Component Win64="$(var.Win64)" Id="cmf_TaAfsServerManager_1033_DLL" Guid="$(var.cmf_TaAfsServerManager_1033_DLL_guid)">
                     <File Id="fileTaAfsServerManager_1033_DLL" Name="tasm1033.dll" LongName="TaAfsServerManager_1033.dll" KeyPath="yes" DiskId="1" src="$(var.ServerDir)\TaAfsServerManager_1033.dll"/>
                 </Component>
+              <?endif?>
+                <Component Win64="$(var.Win64)" Id="cmf_TaAfsAppLib_1033_DLL" Guid="$(var.cmf_TaAfsAppLib_1033_DLL_guid)">
+                    <File Id="fileTaAfsAppLib_1033_DLL" Name="taal1033.dll" LongName="TaAfsAppLib_1033.dll" KeyPath="yes" DiskId="1" src="$(var.ServerDir)\TaAfsAppLib_1033.dll"/>
+                </Component>
                 <Component Win64="$(var.Win64)" Id="cmf_afs_config_1033_DLL" Guid="$(var.cmf_afs_config_1033_DLL_guid)">
                     <File Id="fileafs_config_1033_DLL" Name="acfg1033.dll" LongName="afs_config_1033.dll" KeyPath="yes" DiskId="1" src="$(var.ClientDir)\afs_config_1033.dll"/>
                 </Component>
           <?endif?>
             </Directory> <!-- /common -->
 
-  <?ifndef BinsOnly ?>            
+  <?ifndef BinsOnly ?>
+  <?ifndef LiteClient ?>
             <Directory Id="dirControl_Center" Name="Contr" LongName="Control Center" SourceName="ControlC" LongSource="Control Center">
                 <Component Win64="$(var.Win64)" Id="cmf_TaAfsServerManager_EXE" Guid="$(var.cmf_TaAfsServerManager_EXE_guid)">
                     <File Id="fileTaAfsServerManager_EXE" Name="TaAfsSvM.exe" LongName="TaAfsServerManager.exe" KeyPath="yes" DiskId="1" src="$(var.ServerDir)\TaAfsServerManager.exe">
             <?endif?>
             </Directory> <!-- /Control center -->
   <?endif?>
+  <?endif?>
 
   <?ifndef BinsOnly?>
             <Directory Id="dirDocumentation" Name="Docum" LongName="Documentation" SourceName="Docs">
                 </Directory> <!-- /Program -->
             </Directory> <!-- /Client -->
   <?ifndef BinsOnly ?>
+  <?ifndef LiteClient ?>
             <Directory Id="dirServer" Name="Server">
                 <Directory Id="dirusr" Name="usr">
                     <Directory Id="dirafs" Name="afs">
                 </Directory>
             </Directory> <!-- Server -->
   <?endif?>
-  <?ifndef BinsOnly?>                  
+  <?endif?>
+  <?ifndef BinsOnly?>
+  <?ifndef LiteClient ?>
             <Directory Id="dirSDK" Name="SDK">
                     <Directory Id="dirSample" Name="Sample">
                         <Component Id="cmp_SDK_Sample" Guid="F9373E95-F410-4AA5-AA79-07C11EE00334">
                     </Directory>
             </Directory> <!-- SDK -->
   <?endif?>
+  <?endif?>
 
         </Directory> <!-- AFS -->
     </Directory> <!-- program files -->
index 98dc9a8..210a974 100644 (file)
@@ -4,6 +4,7 @@
     This file will be included as a child of the root Directory tag.
     -->
 <?ifndef BinsOnly ?>
+<?ifndef LiteClient ?>
     <Component Id="rcm_Server" Guid="$(var.rcm_server_guid)" Win64="$(var.Win64)">
         <Registry Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\EventLog\Application\AFS Service" Action="createKeyAndRemoveKeyOnUninstall" Id="reg_Server"/>
         <Registry Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\EventLog\Application\AFS Service" Id="reg_Server3"/>
@@ -61,6 +62,7 @@
         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Control Center\$(var.NumericVersion)" Name="InstallDateString" Type="string" Value="$(var.InstallTimestamp)" Id="reg_Control_Center26" />
         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Control Center\$(var.NumericVersion)" Name="Description" Type="string" Value="$(loc.StrAFSCCDesc)" Id="reg_Control_Center27" />
     </Component>
+    <?endif?>                                                  <!-- /!LiteClient -->
     <Component Id="rcm_Client" Guid="$(var.rcm_client_guid)" Win64="$(var.Win64)">
         <Registry Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" Id="reg_Client_NoUninstall2" />
         <Registry Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" Action="createKey" Id="reg_Client_NoUninstall" />
         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Supplemental Documentation\$(var.NumericVersion)" Name="InstallDateString" Type="string" Value="$(var.InstallTimestamp)" Id="reg_Docs26" />
         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Supplemental Documentation\$(var.NumericVersion)" Name="Description" Type="string" Value="$(loc.StrAFSDocDesc)" Id="reg_Docs27" />
     </Component>
+    <?ifndef LiteClient ?>
     <Component Id="rcm_SDK" Guid="$(var.rcm_sdk_guid)" Win64="$(var.Win64)">
         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS SDK" KeyPath="yes" Id="reg_SDK2" />
         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS SDK" Action="createKeyAndRemoveKeyOnUninstall" Id="reg_SDK" />
         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS SDK\$(var.NumericVersion)" Name="InstallDateString" Type="string" Value="$(var.InstallTimestamp)" Id="reg_SDK26" />
         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS SDK\$(var.NumericVersion)" Name="Description" Type="string" Value="$(loc.StrAFSSDKDesc)" Id="reg_SDK27" />
     </Component>
+    <?endif?>                   <!-- /!LiteClient-->
 
     <!-- Work around bug KB30673.  Only for Windows 2000. -->    
     <Component Id="rcm_KB301673" Guid="$(var.rcm_kb301673_guid)" Win64="$(var.Win64)">