J'ai installé WAPT dans mon environnement d'entreprise pour installer des softs a distance, je suis plutôt satisfait, mon objectif est de faire des paquets pour tous les softs que nous utilisons, cependant il y'en a beaucoup et certains sont très mal packagés, je suis actuellement en train de préparer un paquet pour SRIM 2013 ( http://www.srim.org/SRIM/SRIMLEGL.htm ), le logiciel ne dispose pas d'installeur mais necessite tout de même d'enregistrer des OCX, installer des dll et une police pour fonctionner correctement, pour ce qui est de la police et des dlls, j'ai trouvé des solutions mais l'enregistrements des OCX, je ne sais pas pourquoi mais l'enregistrement avec la commande Regsvr32 /s ne fonctionne pas, je post donc ici pour savoir si des gens ont été confrontés a la même problèmatique pour enregistrer des OCX et si ils ont une solution a ce problème, du coup mon soft se lance mais certaines fonctions refusent de s'executer du fait que les OCX ne sont pas présents :/
- Version de WAPT installée 1.3.13
- OS du serveur : Linux Debian 9
- OS de la machine d'administration/création des paquets : Windows 7
je test le code suivant qui ne fonctionne pas, j'ai bien mis les fichiers OCX a la racine du paquet, j'ai aussi auparavant tester la commande Regsvr32 toute seule sans succès :/
Code : Tout sélectionner
r# -*- coding: utf-8 -*-
from setuphelpers import *
uninstallkey = []
targetdir = makepath(programfiles64,'SRIM 2013')
exename = 'SRIM.exe'
def install():
print('installing pgip-srim2013')
run(r'install.cmd')
run(r'IF EXIST C:\Windows\SysWOW64 (C:\Windows\SysWOW64\regsvr32.exe /S COMCTL32.OCX) ELSE (C:\Windows\System32\regsvr32.exe /S COMCTL32.OCX)')
run(r'IF EXIST C:\Windows\SysWOW64 (C:\Windows\SysWOW64\regsvr32.exe /S COMDLG32.OCX) ELSE (C:\Windows\System32\regsvr32.exe /S COMDLG32.OCX)')
run(r'IF EXIST C:\Windows\SysWOW64 (C:\Windows\SysWOW64\regsvr32.exe /S MSFLXGRD.OCX) ELSE (C:\Windows\System32\regsvr32.exe /S MSFLXGRD.OCX)')
run(r'IF EXIST C:\Windows\SysWOW64 (C:\Windows\SysWOW64\regsvr32.exe /S TABCTL32.OCX) ELSE (C:\Windows\System32\regsvr32.exe /S TABCTL32.OCX)')
run (r'IF EXIST C:\Windows\SysWOW64 (C:\Windows\SysWOW64\regsvr32.exe /S RICHTX32.OCX) ELSE (C:\Windows\System32\regsvr32.exe /S RICHTX32.OCX)')
register_windows_uninstall(control)
def uninstall():
print('uninstalling pgip-srim2013')
killalltasks(exename)
killalltasks('SR.exe')
if isdir(targetdir):
remove_tree(targetdir)
remove_file(r'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\SRIM 2013.lnk')
unregister_uninstall('pgip-srim2013')
Code : Tout sélectionner
@ECHO OFF
ECHO INSTALLING SRIM 2013
xcopy SRIM_2013 "C:\Program Files\SRIM 2013" /S /I
CLS
xcopy "SRIM 2013.lnk" "C:\ProgramData\Microsoft\Windows\Start Menu\Programs" /S /I
CLS
ECHO ADDING FONTS
addfonts.cmd
CLS
ECHO DONE
Code : Tout sélectionner
REM http://www.msfn.org/board/topic/119612-how-to-install-a-font-via-the-command-line/
@ECHO OFF
TITLE Adding Fonts..
REM Filename: ADD_Fonts.cmd
REM Script to ADD TrueType and OpenType Fonts for Windows
REM By Islam Adel
REM 2012-01-16
REM How to use:
REM Place the batch file inside the folder of the font files OR:
REM Optional Add source folder as parameter with ending backslash and dont use quotes, spaces are allowed
REM example "ADD_fonts.cmd" C:\Folder 1\Folder 2\
IF NOT "%*"=="" SET SRC=%*
ECHO.
ECHO Adding Fonts..
ECHO.
FOR /F %%i in ('dir /b "%SRC%*.*tf"') DO CALL :FONT %%i
REM OPTIONAL REBOOT
REM shutdown -r -f -t 10 -c "Reboot required for Fonts installation"
ECHO.
ECHO Done!
EXIT
:FONT
ECHO.
REM ECHO FILE=%~f1
SET FFILE=%~n1%~x1
SET FNAME=%~n1
SET FNAME=%FNAME:-= %
IF "%~x1"==".otf" SET FTYPE=(OpenType)
IF "%~x1"==".ttf" SET FTYPE=(TrueType)
ECHO FILE=%FFILE%
ECHO NAME=%FNAME%
ECHO TYPE=%FTYPE%
COPY /Y "%SRC%%~n1%~x1" "%SystemRoot%\Fonts\"
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "%FNAME% %FTYPE%" /t REG_SZ /d "%FFILE%" /f
GOTO :EOF
Code : Tout sélectionner
Répertoire de C:\waptdev\pgip-srim2013-wapt
08/03/2018 10:24 <REP> .
08/03/2018 10:24 <REP> ..
06/03/2018 15:53 1ÿ133 addfonts.cmd
23/05/2000 00:58 608ÿ448 ComCtl32.ocx
23/05/2000 00:58 140ÿ488 ComDlg32.ocx
08/03/2018 09:55 255 install.cmd
20/03/1996 06:00 80ÿ008 Linedraw.ttf
22/05/2000 22:58 244ÿ416 MSFlxGrd.ocx
09/03/2004 23:45 212ÿ240 RichTx32.ocx
07/03/2018 10:56 1ÿ322 setup.py
07/03/2018 10:57 1ÿ767 setup.pyc
06/03/2018 16:58 1ÿ331 SRIM 2013.lnk
06/03/2018 14:28 <REP> SRIM_2013
30/08/2001 22:43 209ÿ192 TabCtl32.ocx
07/03/2018 08:48 <REP> WAPT
11 fichier(s) 1ÿ500ÿ600 octets
4 R‚p(s) 1ÿ215ÿ844ÿ352 octets libres