; Xerox Universal Print Driver - Offline USB Installer ; Installs Xerox Global Print Driver for USB-connected printers ; Supports Windows 7+ (includes certificate trust bypass for older systems) [Setup] AppId={{8C4D5E62-6F3B-4E9C-AF2D-9B7E5F4E3C2B}} AppName=Xerox Universal Print Driver (USB) AppVersion=5.1055.3.0 AppPublisher=WJDT AppPublisherURL=http://tsgwp00524.logon.ds.ge.com AppSupportURL=http://tsgwp00524.logon.ds.ge.com AppUpdatesURL=http://tsgwp00524.logon.ds.ge.com CreateAppDir=no ChangesAssociations=no PrivilegesRequired=admin ArchitecturesInstallIn64BitMode=x64compatible OutputDir=.\Output OutputBaseFilename=XeroxOfflineInstaller SolidCompression=yes WizardStyle=modern SetupIconFile=gea-logo.ico WizardImageFile=patrick.bmp WizardSmallImageFile=patrick-sm.bmp CreateUninstallRegKey=no DisableWelcomePage=no [Languages] Name: "english"; MessagesFile: "compiler:Default.isl" [Messages] WelcomeLabel2=This utility will install the Xerox Universal Print Driver for USB-connected printers.%n%nDriver: Xerox Global Print Driver PCL6 v5.1055.3.0%n%nAfter installation:%n1. Connect your Xerox printer via USB%n2. Windows will automatically detect and configure it%n%nClick Next to install the driver. [Files] ; Xerox Universal Print Driver x64 Source: "drivers\xerox_x64\*"; DestDir: "{tmp}\xerox_drivers_x64"; Flags: ignoreversion recursesubdirs; Check: Is64BitInstallMode ; Xerox Universal Print Driver x32 Source: "drivers\xerox_x32\*"; DestDir: "{tmp}\xerox_drivers_x32"; Flags: ignoreversion recursesubdirs; Check: not Is64BitInstallMode [Code] procedure CurStepChanged(CurStep: TSetupStep); var BatchScript: String; TempScriptPath: String; ResultCode: Integer; IsX64: Boolean; XeroxDriverPath, XeroxDriverDir, TempDir: String; begin if CurStep = ssPostInstall then begin // Determine architecture and driver paths IsX64 := Is64BitInstallMode; TempDir := ExpandConstant('{tmp}'); if IsX64 then begin XeroxDriverPath := ExpandConstant('{tmp}\xerox_drivers_x64\UNIV_5.1055.3.0_PCL6_x64_Driver.inf\x3UNIVX.inf'); XeroxDriverDir := ExpandConstant('{tmp}\xerox_drivers_x64\UNIV_5.1055.3.0_PCL6_x64_Driver.inf'); end else begin XeroxDriverPath := ExpandConstant('{tmp}\xerox_drivers_x32\x3UNIVX.inf'); XeroxDriverDir := ExpandConstant('{tmp}\xerox_drivers_x32'); end; // Build installation batch script BatchScript := '@echo off' + #13#10 + 'setlocal enabledelayedexpansion' + #13#10 + '' + #13#10 + 'echo.' + #13#10 + 'echo ========================================' + #13#10 + 'echo Xerox Universal Print Driver Installer' + #13#10 + 'echo ========================================' + #13#10 + 'echo.' + #13#10 + '' + #13#10 + 'set "DRIVER_NAME=Xerox Global Print Driver PCL6"' + #13#10 + 'set "INF_FILE=' + XeroxDriverPath + '"' + #13#10 + 'set "DRIVER_DIR=' + XeroxDriverDir + '"' + #13#10 + 'set "CAT_FILE=%DRIVER_DIR%\x3UNIVx.cat"' + #13#10 + '' + #13#10 + 'echo Step 1: Installing driver certificate to trusted store...' + #13#10 + 'echo.' + #13#10 + '' + #13#10 + 'REM Find the catalog file' + #13#10 + 'if not exist "%CAT_FILE%" (' + #13#10 + ' for %%f in ("%DRIVER_DIR%\*.cat") do (' + #13#10 + ' set "CAT_FILE=%%f"' + #13#10 + ' )' + #13#10 + ')' + #13#10 + '' + #13#10 + 'if exist "%CAT_FILE%" (' + #13#10 + ' echo Catalog file: %CAT_FILE%' + #13#10 + ' echo.' + #13#10 + '' + #13#10 + ' REM Add catalog directly to TrustedPublisher store' + #13#10 + ' REM This works! Adds as Certificate Trust List (CTL)' + #13#10 + ' certutil -addstore TrustedPublisher "%CAT_FILE%" >nul 2>&1' + #13#10 + ' if !errorlevel! equ 0 (' + #13#10 + ' echo Certificate catalog added to TrustedPublisher store' + #13#10 + ' ) else (' + #13#10 + ' echo Note: certutil returned !errorlevel! - may already be installed' + #13#10 + ' )' + #13#10 + ') else (' + #13#10 + ' echo WARNING: No catalog file found - continuing anyway...' + #13#10 + ')' + #13#10 + '' + #13#10 + 'echo.' + #13#10 + 'echo Step 2: Disabling driver signature enforcement...' + #13#10 + 'echo.' + #13#10 + '' + #13#10 + 'REM Set driver signing policy to Ignore (0) - prevents "untrusted" dialogs' + #13#10 + 'reg add "HKLM\SOFTWARE\Microsoft\Driver Signing" /v Policy /t REG_BINARY /d 00 /f >nul 2>&1' + #13#10 + 'if !errorlevel! equ 0 (' + #13#10 + ' echo Driver signing policy set to Ignore' + #13#10 + ') else (' + #13#10 + ' echo Note: Could not set driver signing policy' + #13#10 + ')' + #13#10 + '' + #13#10 + 'REM Also set via Group Policy registry key' + #13#10 + 'reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Driver Signing" /v BehaviorOnFailedVerify /t REG_DWORD /d 0 /f >nul 2>&1' + #13#10 + '' + #13#10 + 'echo.' + #13#10 + 'echo Step 3: Installing printer driver...' + #13#10 + 'echo.' + #13#10 + '' + #13#10 + 'if not exist "%INF_FILE%" (' + #13#10 + ' echo ERROR: INF file not found: %INF_FILE%' + #13#10 + ' echo.' + #13#10 + ' pause' + #13#10 + ' exit /b 1' + #13#10 + ')' + #13#10 + 'echo INF file: %INF_FILE%' + #13#10 + 'echo.' + #13#10 + '' + #13#10 + 'echo Adding driver to Windows driver store...' + #13#10 + 'echo.' + #13#10 + '' + #13#10 + 'REM Try Windows 7 syntax first (works on all Windows versions)' + #13#10 + 'REM -i = install on matching devices, -a = add driver package' + #13#10 + 'pnputil -i -a "%INF_FILE%"' + #13#10 + 'set PNPRESULT=!errorlevel!' + #13#10 + '' + #13#10 + 'REM If Windows 7 syntax fails, try Windows 10+ syntax' + #13#10 + 'if !PNPRESULT! neq 0 (' + #13#10 + ' echo.' + #13#10 + ' echo Trying alternative syntax...' + #13#10 + ' pnputil /add-driver "%INF_FILE%" /install' + #13#10 + ' set PNPRESULT=!errorlevel!' + #13#10 + ')' + #13#10 + '' + #13#10 + 'echo.' + #13#10 + '' + #13#10 + 'if !PNPRESULT! equ 0 (' + #13#10 + ' echo Driver added to store successfully' + #13#10 + ') else if !PNPRESULT! equ 259 (' + #13#10 + ' echo Driver already in store' + #13#10 + ') else (' + #13#10 + ' echo pnputil returned: !PNPRESULT!' + #13#10 + ' echo Trying PrintUI method...' + #13#10 + ' echo.' + #13#10 + ' rundll32 printui.dll,PrintUIEntry /ia /m "%DRIVER_NAME%" /f "%INF_FILE%"' + #13#10 + ')' + #13#10 + '' + #13#10 + 'echo.' + #13#10 + 'echo ========================================' + #13#10 + 'echo.' + #13#10 + 'echo Installation complete!' + #13#10 + 'echo.' + #13#10 + 'echo Driver: %DRIVER_NAME%' + #13#10 + 'echo.' + #13#10 + 'echo Next Steps:' + #13#10 + 'echo 1. Connect your Xerox printer via USB' + #13#10 + 'echo 2. Windows will automatically detect it' + #13#10 + 'echo 3. Printer will appear in Devices and Printers' + #13#10 + 'echo.' + #13#10 + 'echo ========================================' + #13#10 + 'echo.' + #13#10 + 'pause'; // Save and execute batch script TempScriptPath := ExpandConstant('{tmp}\install_xerox_driver.bat'); SaveStringToFile(TempScriptPath, BatchScript, False); Exec('cmd.exe', '/c "' + TempScriptPath + '"', '', SW_SHOW, ewWaitUntilTerminated, ResultCode); DeleteFile(TempScriptPath); end; end; // Skip directory selection page function ShouldSkipPage(PageID: Integer): Boolean; begin Result := False; if PageID = wpSelectDir then Result := True; end;