Skip to content

Commit

Permalink
installer: Select Win7/8/8.1 vs. Win10 driver at runtime
Browse files Browse the repository at this point in the history
Rather than shipping separate installers for Windows 10 and pre Windows
10, pack all Windows driver and extend selection logic to install
correct one.

Signed-off-by: Simon Rozman <simon@rozman.si>
  • Loading branch information
rozmansi committed Nov 9, 2019
1 parent 01fbfb9 commit 912e3d2
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions installer/tap-windows6.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ ReserveFile "install-whirl.bmp"
Section /o "TAP Virtual Ethernet Adapter" SecTAP

SetOverwrite on
${If} ${IsWow64}
SetRegView 64
${EndIf}

ReadRegDWORD $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "CurrentMajorVersionNumber"

${If} ${RunningX64}
DetailPrint "We are running on an x86_64 64-bit system."
Expand All @@ -114,9 +119,15 @@ Section /o "TAP Virtual Ethernet Adapter" SecTAP
File "${DEVCON64}"

SetOutPath "$INSTDIR\driver"
File "${IMAGE}\amd64\OemVista.inf"
File "${IMAGE}\amd64\${PRODUCT_TAP_WIN_COMPONENT_ID}.cat"
File "${IMAGE}\amd64\${PRODUCT_TAP_WIN_COMPONENT_ID}.sys"
${If} $R0 == ""
File "${IMAGE}\amd64\OemVista.inf"
File "${IMAGE}\amd64\${PRODUCT_TAP_WIN_COMPONENT_ID}.cat"
File "${IMAGE}\amd64\${PRODUCT_TAP_WIN_COMPONENT_ID}.sys"
${Else}
File "${IMAGE}\amd64-win10\OemVista.inf"
File "${IMAGE}\amd64-win10\${PRODUCT_TAP_WIN_COMPONENT_ID}.cat"
File "${IMAGE}\amd64-win10\${PRODUCT_TAP_WIN_COMPONENT_ID}.sys"
${EndIf}
${ElseIf} ${RunningArm64}
DetailPrint "We are running on an ARM64 64-bit system."

Expand All @@ -134,9 +145,15 @@ Section /o "TAP Virtual Ethernet Adapter" SecTAP
File "${DEVCON32}"

SetOutPath "$INSTDIR\driver"
File "${IMAGE}\i386\OemVista.inf"
File "${IMAGE}\i386\${PRODUCT_TAP_WIN_COMPONENT_ID}.cat"
File "${IMAGE}\i386\${PRODUCT_TAP_WIN_COMPONENT_ID}.sys"
${If} $R0 == ""
File "${IMAGE}\i386\OemVista.inf"
File "${IMAGE}\i386\${PRODUCT_TAP_WIN_COMPONENT_ID}.cat"
File "${IMAGE}\i386\${PRODUCT_TAP_WIN_COMPONENT_ID}.sys"
${Else}
File "${IMAGE}\i386-win10\OemVista.inf"
File "${IMAGE}\i386-win10\${PRODUCT_TAP_WIN_COMPONENT_ID}.cat"
File "${IMAGE}\i386-win10\${PRODUCT_TAP_WIN_COMPONENT_ID}.sys"
${EndIf}
${Else}
DetailPrint "Native architecture not recognized!"
${EndIf}
Expand Down

0 comments on commit 912e3d2

Please sign in to comment.