Page 1 of 1

Crouzet-Soft package problem

Published: November 30, 2022 - 11:11 AM
by gaelds
Good morning,

I have a problem with a Crouzet Soft 1.12 package. The 'USB driver installation' part seems to go well and the software is installed on the machines, but the "Device Driver Installation Wizard" window appears and waits for a click on next, so the package ends with an error after 300s.


EDIT: My problem seems to be solved, but I don't know exactly what worked in my latest changes... In any case, if anyone needs this package, here's the setup.py file. The "DriverUSB" folder was copied from the software's installation folder.

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *
uninstallkey = []

app_name = 'Crouzet-Soft'
app_dir = makepath(programfiles32, 'Crouzet automation')
app_dir_binaries = makepath(app_dir,'Crouzet-Soft')
binary_name = "Crouzet-Soft.exe"
kill_list = [binary_name]
shortcutsdir = makepath(common_desktop(),'Logiciels','Elec - Automatisme')
uninstall_string = r'"C:\Program Files (x86)\Crouzet automation\Crouzet-Soft\unins000.exe" /silent'

def install():
    print(r'Désinstallation de l\'ancienne version')
    versionsoft = control['version'].split('-',1)[0]
    softname = 'Crouzet-Soft'
    check_installed_soft = installed_softwares(softname)

    if check_installed_soft:
        for uninstall in check_installed_soft:
            cmd = WAPT.uninstall_cmd(uninstall['key'])
            run(cmd)

    print(r'Installation des pilotes USB')
    currentpath = os.path.dirname(os.path.realpath(__file__))
    ##run_notfatal(r'%s\drivers\dpinst.exe /SW /F'  % currentpath)
    with disable_file_system_redirection():
        run_notfatal(r'C:\Windows\System32\pnputil.exe -i -a "%s\DriverUSB\x64\ftdibus.inf"' % basedir)
        run_notfatal(r'C:\Windows\System32\pnputil.exe -i -a "%s\DriverUSB\x64\ftdiport.inf"' % basedir)
        run_notfatal(r'C:\Windows\System32\pnputil.exe -i -a "%s\DriverUSB\windrv_BLE\x64\dfu.inf"' % basedir)
        run_notfatal(r'C:\Windows\System32\pnputil.exe -i -a "%s\DriverUSB\windrv_BLE\x64\usbserial.inf"' % basedir)

    print(u'Installation de %s' % app_name)
    install_exe_if_needed('Setup_CrouzetSoft_1.12.02.07.exe',
        silentflags='/SILENT /VERYSILENT /SUPPRESSMSGBOXES /NORESTART',
        key='6BCD8694-FAB1-406E-83E4-263BAAD2B163_is1',
        min_version=' '
    )

    print(r'Creation du raccourci %s sur le bureau public' %app_name)
    if not isdir(shortcutsdir):
        mkdirs(shortcutsdir)
    create_shortcut(makepath(shortcutsdir,'%s.lnk' %app_name), target=makepath(app_dir_binaries,binary_name))
    remove_desktop_shortcut(app_name)


def uninstall():
    print(r"Desinstallation de %s" %app_name)
    run_notfatal(r'%s' % uninstall_string)
    if  isfile(makepath(shortcutsdir,'%s.lnk' %app_name)):
        remove_file(makepath(shortcutsdir,'%s.lnk' %app_name))

def audit():
    if isfile(makepath(app_dir_binaries,binary_name)):
        return("OK")