我正在尝试制作安装脚本:
- 在 32 位电脑上:tapi_32bits.tsp 在C:\windows\system32
- 在 64 位电脑上:tapi_64bits.tspC:\Windows\System32和 tapi_32bits.tspC:\Windows\SysWOW64
这是我写的脚本:
; The name of the installer
Name "TAPI Installer"
; The file to write
OutFile "TAPI Installer"
; The default installation directory
InstallDir $DESKTOP
;--------------------------------
; Install to the correct directory on 32 bit or 64 bit machines
Section
IfFileExists $WINDIR\SYSWOW64\*.* Is64bit Is32bit
Is32bit:
    ; Set output path to the installation directory.
    SetOutPath $SYSDIR
    ; Put file there
    File tapi_32bits.tsp
;   SectionEnd MessageBox MB_OK "32 bit"
        SetRegView 32
        StrCpy $INSTDIR "$PROGRAMFILES32\LANDesk\Health Check"
    GOTO End32Bitvs64BitCheck
Is64bit:
    ; install in  C:\Windows\System32
    SetOutPath $WINDIR\System32\
    ; file to put there
    File tapi_64bits.tsp
    ; install in C:\Windows\SysWOW64
    SetOutPath $WINDIR\SysWOW64
    ; file to put there
    File tapi_32bits.tsp
    ;SectionEnd MessageBox MB_OK "32 bit"
        SetRegView 32
        StrCpy $INSTDIR "$PROGRAMFILES32\LANDesk\Health Check"
        GOTO End32Bitvs64BitCheck    
    MessageBox MB_OK "64 bit"
        SetRegView 64
        StrCpy $INSTDIR "$PROGRAMFILES64\LANDesk\Health Check"
End32Bitvs64BitCheck:
SectionEnd
;--------------------------------
但在 64 位电脑上,它将两个文件(tapi_64bits.tsp 和 tapi_32bits.tsp)都放在 Syswow64 文件夹中。安装程序确实说它安装在正确的文件夹中,但两个文件都在 Syswow64 文件夹中。我究竟做错了什么?