I installed WAPT in my company environment to install software remotely, I'm quite satisfied. My goal is to create packages for all the software we use; however, there are many and some are very poorly packaged. I'm currently preparing a package for SRIM 2013 ( http://www.srim.org/SRIM/SRIMLEGL.htm The software doesn't have an installer, but it still requires registering OCX files, installing DLLs, and a font to function correctly. I've found solutions for the font and DLLs, but registering the OCX files—I don't know why—doesn't work with the command `Regsvr32 /s`. So I'm posting here to see if anyone else has encountered the same problem registering OCX files and if they have a solution. My software launches, but some functions refuse to run because the OCX files aren't present
- Installed WAPT version 1.3.13
- Server OS: Linux Debian 9
- Operating system of the administration/package creation machine: Windows 7
I'm testing the following code which isn't working. I've correctly placed the OCX files in the root directory of the package, and I also previously tested the Regsvr32 command on its own without success. :/
Code: Select all
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: Select all
@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 DONECode: Select all
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 :EOFCode: Select all
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
