windows-nsis-vs2008-runtime-20080715
authorAsanka Herath <asanka@secure-endpoints.com>
Wed, 16 Jul 2008 00:58:28 +0000 (00:58 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 16 Jul 2008 00:58:28 +0000 (00:58 +0000)
LICENSE MIT

Add support for VS2008

Use MSI runtime installation package instead of EXE package

Cleanup runtime from the correct directory

src/WINNT/install/NSIS/NTMakefile
src/WINNT/install/NSIS/OpenAFS.nsi
src/WINNT/install/NSIS/vcruntime.wxs

index e6177eb..7740832 100644 (file)
@@ -71,6 +71,23 @@ IDNMREDIST=$(MSIDNNLS)\REDIST\idndl.amd64.exe
 ! error Unknown CPU value
 !ENDIF
 
+!if ("$(AFSVER_CL)"=="1400") || ("$(AFSVER_CL)"=="1500")
+MSVCMSI=$(EXEDIR)\vcruntime-$(AFSVER_CL)$(AFSDEV_BUILDTYPE).msi
+
+$(MSVCMSI): $(OUT)\vcruntime.wixobj
+       light -out $@ $**
+       $(CODESIGN_USERLAND)
+
+$(OUT)\vcruntime.wixobj: vcruntime.wxs
+       candle -out $@ $** -dPlatform=$(ARCH) -dConfig=Debug -dVCVer=$(AFSVER_CL)
+
+!else
+MSVCMSI=
+!endif
+
+runtime: $(MSVCMSI)
+
+
 prebuild:
 !IF ("$(AFSDEV_BUILDTYPE)" == "FREE")
 !IF ("$(AFSVER_CL)"=="1400")
@@ -89,7 +106,9 @@ prebuild:
 !ERROR Unknown Compiler Version
 !ENDIF
 !ELSE # NOT FREE - CHECKED
-!IF ("$(AFSVER_CL)"=="1400")
+!IF ("$(AFSVER_CL)"=="1500")
+# Do nothing
+!ELSE IF ("$(AFSVER_CL)"=="1400")
 # Do nothing.
 !ELSE IF ("$(AFSVER_CL)"=="1310")
    $(COPY) %SystemRoot%\System32\Msvcr71d.dll $(EXEDIR)
@@ -122,9 +141,12 @@ prebuild:
    $(DESTDIR)\bin\util_cr.exe _echo "!define " >>$(OUT)\nsi-includes.nsi 
    "$(NSISDIR)\makensis.exe" /VERSION >>$(OUT)\nsi-includes.nsi          
    echo. >>$(OUT)\nsi-includes.nsi                                       
-!if ("$(AFSVER_CL)" == "1400")
+!if ("$(AFSVER_CL)" == "1500")
+   echo !define CL_1500 1 >> $(OUT)\nsi-includes.nsi
+   echo !define MSVCMSI "$(MSVCMSI)" >> $(OUT)\nsi-includes.nsi
+!else if ("$(AFSVER_CL)" == "1400")
    echo !define CL_1400 1 >> $(OUT)\nsi-includes.nsi
-   echo !define VCREDISTNAME vcredist_$(ARCH).exe >> $(OUT)\nsi-includes.nsi
+   echo !define MSVCMSI "$(MSVCMSI)" >> $(OUT)\nsi-includes.nsi
 !else if ("$(AFSVER_CL)" == "1310")
    echo !define CL_1310 1 >> $(OUT)\nsi-includes.nsi
 !else if ("$(AFSVER_CL)" == "1300")
@@ -137,29 +159,13 @@ prebuild:
    echo !define DEBUG 1 >>$(OUT)\nsi-includes.nsi
 !endif
 
-!if ("$(AFSVER_CL)"=="1400") && ("$(AFSDEV_BUILDTYPE)"!="FREE")
-MSVCMSI=$(EXEDIR)\vcruntime.msi
-
-$(MSVCMSI): $(OUT)\vcruntime.wixobj
-       light -out $@ $**
-       $(CODESIGN_USERLAND)
-
-$(OUT)\vcruntime.wixobj: vcruntime.wxs
-       candle -out $@ $** -dPlatform=$(ARCH) -dConfig=Debug
-
-!else
-MSVCMSI=
-!endif
-
-runtime: $(MSVCMSI)
-
 !if ("$(AFSDEV_BUILDTYPE)" == "CHECKED")
 NSISEXE=$(DESTDIR)\WinInstall\OpenAFSforWindows-DEBUG.exe
 !else
 NSISEXE=$(DESTDIR)\WinInstall\OpenAFSforWindows.exe
 !endif
 
-$(NSISEXE): prebuild
+$(NSISEXE): prebuild $(MSVCMSI)
        "$(NSISDIR)\makensis.exe" /DINCLUDEDIR=$(OUT) OpenAFS.nsi
        $(CODESIGN_USERLAND)
 
index 702d5ca..5dc2057 100644 (file)
@@ -1239,6 +1239,9 @@ DoControl:
 
 DoCommon:
   SetOutPath "$INSTDIR\Common"
+!IFDEF CL_1500
+  ; Do nothing
+!ELSE
 !IFDEF CL_1400
   ; Do nothing
 !ELSE
@@ -1258,6 +1261,7 @@ DoCommon:
 !ENDIF
 !ENDIF
 !ENDIF
+!ENDIF
   
 ; Common Areas
    SetOutPath "$INSTDIR\Common"
@@ -1721,72 +1725,89 @@ StartRemove:
    Delete /REBOOTOK "$INSTDIR\Common\afskasadmin.pdb"
    Delete /REBOOTOK "$INSTDIR\Common\afsptsadmin.pdb"
 !IFDEF DEBUG
+!IFDEF CL_1500
+   SetOutPath "$INSTDIR\Common"
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
+!ELSE
 !IFDEF CL_1400
-   SetOutPath "$INSTDIR\bin"
-   File "${AFS_WININSTALL_DIR}\vcruntime.msi"
-   nsExec::Exec 'msiexec /x "$INSTDIR\bin\vcruntime.msi" /passive'
-   Delete "$INSTDIR\bin\vcruntime.msi"
+   SetOutPath "$INSTDIR\Common"
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
 !ELSE
 !IFDEF CL_1310
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\mfc71d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\mfc71d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr71d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr71d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp71d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp71d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc71d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc71d.pdb"
 !ELSE
 !IFDEF CL_1300
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\mfc70d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\mfc70d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr70d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr70d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp70d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp70d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc70d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc70d.pdb"
 !ELSE
-   Delete /REBOOTOK "$INSTDIR\bin\mfc42d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\mfc42d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc42d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc42d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp60d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp60d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcrtd.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcrtd.pdb"
+!ENDIF
 !ENDIF
 !ENDIF
 !ENDIF
 !ELSE
+!IFDEF CL_1500
+   SetOutPath "$INSTDIR\Common"
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
+!ELSE
 !IFDEF CL_1400
-   ; Do nothing
+   SetOutPath "$INSTDIR\Common"
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
 !ELSE
 !IFDEF CL_1310
-   Delete /REBOOTOK "$INSTDIR\bin\mfc71.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr71.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp71.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71CHS.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71CHT.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71DEU.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71ENU.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71ESP.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71FRA.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71ITA.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71JPN.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71KOR.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc71.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr71.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp71.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71CHS.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71CHT.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71DEU.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71ENU.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71ESP.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71FRA.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71ITA.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71JPN.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71KOR.DLL"
 !ELSE
 !IFDEF CL_1300
-   Delete /REBOOTOK "$INSTDIR\bin\mfc70.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr70.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp70.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70CHS.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70CHT.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70DEU.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70ENU.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70ESP.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70FRA.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70ITA.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70JPN.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70KOR.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc70.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr70.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp70.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70CHS.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70CHT.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70DEU.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70ENU.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70ESP.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70FRA.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70ITA.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70JPN.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70KOR.DLL"
 !ELSE
-   Delete /REBOOTOK "$INSTDIR\bin\mfc42.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp60.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcrt.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc42.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp60.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcrt.dll"
+!ENDIF
 !ENDIF
 !ENDIF
 !ENDIF
@@ -1897,69 +1918,89 @@ StartRemove:
   RMDir  "$INSTDIR\Client"
 
 !IFDEF DEBUG  
+!IFDEF CL_1500
+   SetOutPath "$INSTDIR\Common"
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
+!ELSE
 !IFDEF CL_1400
-   ; Do nothing
+   SetOutPath "$INSTDIR\Common"
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
 !ELSE
 !IFDEF CL_1310
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\mfc71d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\mfc71d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr71d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr71d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp71d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp71d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc71d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc71d.pdb"
 !ELSE
 !IFDEF CL_1300
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\mfc70d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\mfc70d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr70d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr70d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp70d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp70d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc70d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc70d.pdb"
 !ELSE
-   Delete /REBOOTOK "$INSTDIR\bin\mfc42d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\mfc42d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.pdb"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc42d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc42d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp60d.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp60d.pdb"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcrtd.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcrtd.pdb"
+!ENDIF
 !ENDIF
 !ENDIF
 !ENDIF
 !ELSE
+!IFDEF CL_1500
+   SetOutPath "$INSTDIR\Common"
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
+!ELSE
 !IFDEF CL_1400
-   ; Do nothing
+   SetOutPath "$INSTDIR\Common"
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
 !ELSE
 !IFDEF CL_1310
-   Delete /REBOOTOK "$INSTDIR\bin\mfc71.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr71.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp71.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71CHS.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71CHT.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71DEU.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71ENU.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71ESP.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71FRA.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71ITA.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71JPN.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC71KOR.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc71.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr71.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp71.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71CHS.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71CHT.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71DEU.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71ENU.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71ESP.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71FRA.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71ITA.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71JPN.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC71KOR.DLL"
 !ELSE
 !IFDEF CL_1300
-   Delete /REBOOTOK "$INSTDIR\bin\mfc70.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcr70.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp70.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70CHS.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70CHT.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70DEU.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70ENU.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70ESP.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70FRA.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70ITA.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70JPN.DLL"
-   Delete /REBOOTOK "$INSTDIR\bin\MFC70KOR.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc70.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcr70.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp70.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70CHS.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70CHT.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70DEU.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70ENU.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70ESP.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70FRA.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70ITA.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70JPN.DLL"
+   Delete /REBOOTOK "$INSTDIR\Common\MFC70KOR.DLL"
 !ELSE
-   Delete /REBOOTOK "$INSTDIR\bin\mfc42.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcp60.dll"
-   Delete /REBOOTOK "$INSTDIR\bin\msvcrt.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\mfc42.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcp60.dll"
+   Delete /REBOOTOK "$INSTDIR\Common\msvcrt.dll"
+!ENDIF
 !ENDIF
 !ENDIF
 !ENDIF
@@ -2751,9 +2792,14 @@ Function AFSLangFiles
  SetOutPath "$INSTDIR\Common"
 
 !IFDEF DEBUG
+!IFDEF CL_1500
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /i "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
+!ELSE
 !IFDEF CL_1400
-   File "${AFS_WININSTALL_DIR}\vcruntime.msi"
-   nsExec::Exec 'msiexec /i "$INSTDIR\Common\vcruntime.msi" /passive'
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /i "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
    Delete "$INSTDIR\Common\vcruntime.msi"
 !ELSE
 !IFDEF CL_1310
@@ -2790,11 +2836,17 @@ Function AFSLangFiles
 !ENDIF
 !ENDIF
 !ENDIF
+!ENDIF
+!ELSE
+!IFDEF CL_1500
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /i "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
 !ELSE
 !IFDEF CL_1400
-  File "${AFS_WININSTALL_DIR}\${VCREDISTNAME}"
-  nsExec::Exec '"$INSTDIR\Common\${VCREDISTNAME}" /Q'
-  Delete "$INSTDIR\Common\${VCREDISTNAME}"
+   File /oname=vcruntime.msi "${MSVCMSI}"
+   nsExec::Exec 'msiexec /i "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
+   Delete "$INSTDIR\Common\vcruntime.msi"
 !ELSE
 !IFDEF CL_1310
    !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc71.dll" "$INSTDIR\Common\mfc71.dll" "$INSTDIR"
@@ -2831,6 +2883,7 @@ Function AFSLangFiles
 !ENDIF
 !ENDIF   
 !ENDIF
+!ENDIF
 
    StrCmp $LANGUAGE ${LANG_ENGLISH} DoEnglish
    StrCmp $LANGUAGE ${LANG_GERMAN} DoGerman
index 1d0f000..eb29101 100644 (file)
@@ -1,16 +1,42 @@
 <?xml version="1.0" ?>
 <Wix xmlns='http://schemas.microsoft.com/wix/2003/01/wi'>
 
+  <!--
+
+      External defines:
+
+      Platform : Must be set to Intel, x64 or Intel64 to indicate the target architecture.
+      VCVer : 14 or 15.  Corresponds to the version of the VC compiler.
+      Config : Retail or Debug.
+
+      -->
+
   <?ifndef Config?>
     <?define Config=Debug?>
   <?endif?>
 
+  <?ifndef VCVer?>
+    <?define VCVer=14?>
+  <?endif?>
+
+  <?if $(var.VCVer) = "1400"?>
+    <?define VString=8.0?>
+    <?define VCU=8_0?>
+    <?define VCV=VC80?>
+  <?elseif $(var.VCVer) = "1500"?>
+    <?define VString=9.0?>
+    <?define VCU=9_0?>
+    <?define VCV=VC90?>
+  <?else?>
+    <?error Unknown VCVer value?>
+  <?endif?>
+
     <Product
        Id="????????-????-????-????-????????????"
        Codepage="1252"
        Language="1033"
        Manufacturer="Microsoft Corporation"
-       Name="Visual C++ 8.0 $(var.Config) ($(var.Platform)) Runtime"
+       Name="Visual Studio $(var.VString) $(var.Config) ($(var.Platform)) Runtime"
        UpgradeCode="1184DE9F-813A-4DB3-8533-BB7D4E51D695"
        Version="0.1.0.0"
        >
@@ -19,7 +45,7 @@
          AdminImage="no"
          Comments="Copyright (C) Microsoft Corporation, All rights reserved."
          Compressed="yes"
-         Description="Visual C++ 8.0 $(var.Config) ($(var.Platform)) WinSXS MSM"
+         Description="Visual C++ $(var.VString) $(var.Config) ($(var.Platform)) WinSXS MSM"
          InstallerVersion="300"
          Keywords="Installer,VC,$(var.Config),Runtime"
          Manufacturer="Microsoft Corporation"
 
        <?if $(var.Platform) = "x64" ?>
          <?if $(var.Config) = "Retail" ?>
-           <Merge Id="MSVCRT8MEM" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_VC80_CRT_x86_x64.msm"/>
-           <Merge Id="MSVCRT8POL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_8_0_Microsoft_VC80_CRT_x86_x64.msm"/>
-           <Merge Id="MSVCRT8MFC" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_VC80_MFC_x86_x64.msm"/>
-           <Merge Id="MSVCRT8PFC" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_8_0_Microsoft_VC80_MFC_x86_x64.msm"/>
-           <Merge Id="MSVCRT8MFL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_VC80_MFCLOC_x86_x64.msm"/>
-           <Merge Id="MSVCRT8PFL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_8_0_Microsoft_VC80_MFCLOC_x86_x64.msm"/>
+           <Merge Id="MSVCRTMEM" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_$(var.VCV)_CRT_x86_x64.msm"/>
+           <Merge Id="MSVCRTPOL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_$(var.VCU)_Microsoft_$(var.VCV)_CRT_x86_x64.msm"/>
+           <Merge Id="MSVCRTMFC" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_$(var.VCV)_MFC_x86_x64.msm"/>
+           <Merge Id="MSVCRTPFC" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_$(var.VCU)_Microsoft_$(var.VCV)_MFC_x86_x64.msm"/>
+           <Merge Id="MSVCRTMFL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_$(var.VCV)_MFCLOC_x86_x64.msm"/>
+           <Merge Id="MSVCRTPFL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_$(var.VCU)_Microsoft_$(var.VCV)_MFCLOC_x86_x64.msm"/>
          <?else?>
-           <Merge Id="MSVCRT8MEM" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_VC80_DebugCRT_x86_x64.msm"/>
-           <Merge Id="MSVCRT8POL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_8_0_Microsoft_VC80_DebugCRT_x86_x64.msm"/>
-           <Merge Id="MSVCRT8MFC" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_VC80_DebugMFC_x86_x64.msm"/>
-           <Merge Id="MSVCRT8PFC" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_8_0_Microsoft_VC80_DebugMFC_x86_x64.msm"/>
-           <Merge Id="MSVCRT8MFL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_VC80_MFCLOC_x86_x64.msm"/>
-           <Merge Id="MSVCRT8PFL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_8_0_Microsoft_VC80_MFCLOC_x86_x64.msm"/>
+           <Merge Id="MSVCRTMEM" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_$(var.VCV)_DebugCRT_x86_x64.msm"/>
+           <Merge Id="MSVCRTPOL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_$(var.VCU)_Microsoft_$(var.VCV)_DebugCRT_x86_x64.msm"/>
+           <Merge Id="MSVCRTMFC" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_$(var.VCV)_DebugMFC_x86_x64.msm"/>
+           <Merge Id="MSVCRTPFC" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_$(var.VCU)_Microsoft_$(var.VCV)_DebugMFC_x86_x64.msm"/>
+           <Merge Id="MSVCRTMFL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_$(var.VCV)_MFCLOC_x86_x64.msm"/>
+           <Merge Id="MSVCRTPFL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_$(var.VCU)_Microsoft_$(var.VCV)_MFCLOC_x86_x64.msm"/>
          <?endif?>
         <?else?>
          <?if $(var.Config) = "Retail" ?>
-           <Merge Id="MSVCRT8MEM" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_VC80_CRT_x86.msm"/>
-           <Merge Id="MSVCRT8POL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_8_0_Microsoft_VC80_CRT_x86.msm"/>
-           <Merge Id="MSVCRT8MFC" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_VC80_MFC_x86.msm"/>
-           <Merge Id="MSVCRT8PFC" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_8_0_Microsoft_VC80_MFC_x86.msm"/>
-           <Merge Id="MSVCRT8MFL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_VC80_MFCLOC_x86.msm"/>
-           <Merge Id="MSVCRT8PFL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_8_0_Microsoft_VC80_MFCLOC_x86.msm"/>
+           <Merge Id="MSVCRTMEM" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_$(var.VCV)_CRT_x86.msm"/>
+           <Merge Id="MSVCRTPOL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_$(var.VCU)_Microsoft_$(var.VCV)_CRT_x86.msm"/>
+           <Merge Id="MSVCRTMFC" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_$(var.VCV)_MFC_x86.msm"/>
+           <Merge Id="MSVCRTPFC" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_$(var.VCU)_Microsoft_$(var.VCV)_MFC_x86.msm"/>
+           <Merge Id="MSVCRTMFL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_$(var.VCV)_MFCLOC_x86.msm"/>
+           <Merge Id="MSVCRTPFL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_$(var.VCU)_Microsoft_$(var.VCV)_MFCLOC_x86.msm"/>
          <?else?>
-           <Merge Id="MSVCRT8MEM" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_VC80_DebugCRT_x86.msm"/>
-           <Merge Id="MSVCRT8POL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_8_0_Microsoft_VC80_DebugCRT_x86.msm"/>
-           <Merge Id="MSVCRT8MFC" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_VC80_DebugMFC_x86.msm"/>
-           <Merge Id="MSVCRT8PFC" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_8_0_Microsoft_VC80_DebugMFC_x86.msm"/>
-           <Merge Id="MSVCRT8MFL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_VC80_MFCLOC_x86.msm"/>
-           <Merge Id="MSVCRT8PFL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_8_0_Microsoft_VC80_MFCLOC_x86.msm"/>
+           <Merge Id="MSVCRTMEM" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_$(var.VCV)_DebugCRT_x86.msm"/>
+           <Merge Id="MSVCRTPOL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_$(var.VCU)_Microsoft_$(var.VCV)_DebugCRT_x86.msm"/>
+           <Merge Id="MSVCRTMFC" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_$(var.VCV)_DebugMFC_x86.msm"/>
+           <Merge Id="MSVCRTPFC" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_$(var.VCU)_Microsoft_$(var.VCV)_DebugMFC_x86.msm"/>
+           <Merge Id="MSVCRTMFL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\Microsoft_$(var.VCV)_MFCLOC_x86.msm"/>
+           <Merge Id="MSVCRTPFL" DiskId="1" Language="0" src="$(var.CPF)\Merge Modules\policy_$(var.VCU)_Microsoft_$(var.VCV)_MFCLOC_x86.msm"/>
          <?endif?>
        <?endif?>
       </Directory>
 
       <Feature Id="FeatureAll" AllowAdvertise="no" Absent="disallow"
-               Description="Install VC ++ 8.0 Runtime" Display="expand" InstallDefault="local" Level="3"
+               Description="Install VC ++ $(var.VString) Runtime" Display="expand" InstallDefault="local" Level="3"
                Title="All">
-       <MergeRef Id="MSVCRT8MEM"/>
-       <MergeRef Id="MSVCRT8POL"/>
-       <MergeRef Id="MSVCRT8MFC"/>
-       <MergeRef Id="MSVCRT8PFC"/>
-       <MergeRef Id="MSVCRT8MFL"/>
-       <MergeRef Id="MSVCRT8PFL"/>
+       <MergeRef Id="MSVCRTMEM"/>
+       <MergeRef Id="MSVCRTPOL"/>
+       <MergeRef Id="MSVCRTMFC"/>
+       <MergeRef Id="MSVCRTPFC"/>
+       <MergeRef Id="MSVCRTMFL"/>
+       <MergeRef Id="MSVCRTPFL"/>
       </Feature>  
 
       <Media Id="1" Cabinet="disk1.cab" CompressionLevel="high" EmbedCab="yes" />