Quoi, tu ne connais pas PB ? Va falloir parcourir tout le forum alors !

Le forum (ô combien francophone) des utilisateurs de Powerbuilder.

Recherche rapide

Annonce

Certaines rubriques, dont des cours, sont uniquement visibles par les membres du forum ^^.
Dans la rubrique Liens & Références, vous avez accès à un sommaire de téléchargement, profitez-en !
Il existe maintenant un nouveau TOPIC "Votre CV en Ligne" accessible uniquement par demande.

#1 13-12-2020 10:46:39

FlorentP  
Membre Geek
Award: bf
Lieu: Marseille
Date d'inscription: 23-03-2011
Messages: 95
Pépites: 1,422
Banque: 0

Lancement et lecture des fichiers .HLP des vieux PB sous Win10

Bonjour à tous je viens partager une astuce qui permet de rendre opérationnelle l'aide avec shif+F1 sous les vieux PB ( <=PB9 ) qui utilisent encore les fichiers d'aide .hlp

L'astuce consiste à installer le lecteur du fichier d'aide de windows 8.1 en remplacant notamment le fichier winhelp32.exe de windows 10 qui redirige sur une page web indiquant l'incompatibilité.
Une discussion sur les .hlp ici ->
https://stackoverflow.com/questions/436 … s/43643026

donne la marche à suivre.

Du coup j'ai fait un petit script CMD pour automatiser ça parce qu'a chaque mise à jour majeure de Windows 10 l'opération doit être recommencée.
Les fichier Windows8.1-KB917607-x86.msu et Windows8.1-KB917607-x64.msu doivent être téléchargé chez microsoft.

Code: cmd

@echo off
cls
Setlocal
echo ------------------------------------------------------------
echo - Ver 1  Utilisation des fichiers .hlp sous Windows 10 en utilisant la version de windows 8.1 
REM Explication voir : https://stackoverflow.com/questions/43617504/how-to-convert-hlp-files-into-chm-files/43643026

echo - Test si Windows 10
ver | find /c " 10.0" > nul
IF %errorlevel% EQU 0 GOTO :005
Echo - [ECHEC] Ne s applique qu a windows 10

goto:eof
:005
Echo - [OK] windows 10 detecte

REM Test si admin
@NET SESSION
IF %ERRORLEVEL% EQU 0 goto 010
ECHO - [ECHEC] Droits Admin manquants...

goto:eof
:010
ECHO - [OK] Droits admin

REM Test pour savoir si OS 32 ou 64
Set os_bitness=amd64
IF %PROCESSOR_ARCHITECTURE% == x86 (
  IF NOT DEFINED PROCESSOR_ARCHITEW6432 Set os_bitness=x86
  )


IF %os_bitness% == amd64 (
  SET FILE_MSU=Windows8.1-KB917607-x64.msu
  SET FILE_CAB=Windows8.1-KB917607-x64.cab
  SET REP_PREFIX=amd64_
)

IF %os_bitness% == x86 (
  SET FILE_MSU=Windows8.1-KB917607-x86.msu
  SET FILE_CAB=Windows8.1-KB917607-x86.cab
  SET REP_PREFIX=x86_
}



ECHO - [INF] TYPE OS: %os_bitness%  (amd64 pour 64bits et x86 pour 32bits)
ECHO - [INF] Fichier MSU Utilise: %FILE_MSU%


CHOICE /c ON /t 20 /D N /M "- [???] Voulez-vous continuer ?"
IF %ERRORLEVEL% EQU 1 GOTO :015

GOTO:eof
:015

SET repextract=msu-extracted
SET cabextract=cab-extracted
SET lang=fr-fr

ECHO - [INF] Repertoire d extration .msu=%repextract%
ECHO - [INF] Repertoire d extration .cab=%repextract%\%cabextract%
ECHO - [INF] La langue utilisee est:=%lang%


CHOICE /c ON /t 20 /D N /M " - [???] Voulez-vous continuer ?"
IF %ERRORLEVEL% EQU 2 goto:eof

echo - [INF] poursuite du trt...


mkdir "%repextract%"
IF exist "%repextract%" GOTO 020
ECHO - [ECHEC] Echec de la creation du repertoire.

GOTO:eof
:020



expand %FILE_MSU% /f:* .\%repextract% > nul
IF %ERRORLEVEL% EQU 0 goto 030
ECHO - [ECHEC] Echec expand du msu.

GOTO:eof
:030


cd  "%repextract%"
mkdir "%cabextract%"
IF exist "%cabextract%" GOTO 040
Echo - [ECHEC] Echec création du repertoire cabextract

GOTO:eof
:040
expand %FILE_CAB% /f:* .\%cabextract% > nul
IF %ERRORLEVEL% EQU 0 goto 050
Echo - [ECHEC] Echec expand du cab"

GOTO:eof
:050


echo - [INF] Se place dans le rep de la bonne archi et du la bonne langue.
cd "%cabextract%"
for /d %%i in (%REP_PREFIX%*%lang%*) DO set  REP_MUI="%%i"
echo - [INF] Reperdoire MUI: %REP_MUI%

cd %REP_MUI%


echo ----------------------------------------------------------------------
Echo ------Trake own, grant and rename and replace of winhlp32.exe.mui ----


takeown /f "%systemroot%\%lang%\winhlp32.exe.mui"
echo - [INF] Appropriation de %systemroot%\%lang%\winhlp32.exe.mui
IF %ERRORLEVEL% EQU 0 GOTO 060
echo - [ECHEC] Erreur Appropriation 060

GOTO:eof
:060
echo - [INF] Grant sur %systemroot%\%lang%\winhlp32.exe.mui de %UserName%
icacls "%systemroot%\%lang%\winhlp32.exe.mui" /grant "%UserName%":f
IF %ERRORLEVEL% EQU 0 GOTO 070
echo - [ECHEC] Erreur Grant 070


GOTO:eof
:070
echo - [INF] Renommage de secours du fichier a remplacer en %SystemRoot%\%lang%\winhlp32.exe.mui.win10
if EXIST "%SystemRoot%\%lang%\winhlp32.exe.mui.win10" (
  echo - [WARN] le fichier %SystemRoot%\%lang%\winhlp32.exe.mui.win10 existe deja 
  GOTO 080
 )
move "%SystemRoot%\%lang%\winhlp32.exe.mui" "%SystemRoot%\%lang%\winhlp32.exe.mui.win10"
IF %ERRORLEVEL% EQU 0 GOTO 080
echo - [ECHEC] Erreur renommage 080


GOTO:eof
:080
echo - [INF] Remplacement du fichier winhlp32.exe.mui dans %SystemRoot%\%lang%
copy winhlp32.exe.mui "%SystemRoot%\%lang%\"
IF %ERRORLEVEL% EQU 0 GOTO 090
echo - [ECHEC] Remplacement du fichier winhlp32.exe.mui 090

GOTO:eof
:090
Echo - 
echo ----------------------------------------------------------------------
Echo ------Trake own, grant and rename and replace of winhlp32.exe     ----
cd ..


IF %os_bitness% == amd64 SET REP_WINHLP=amd64_microsoft-windows-winhstb_31bf3856ad364e35_6.3.9600.20470_none_1a54d9f2f676f6c2
IF %os_bitness% == x86   SET REP_WINHLP=x86_microsoft-windows-winhstb_31bf3856ad364e35_6.3.9600.20470_none_be363e6f3e19858c
cd %REP_WINHLP%
IF %ERRORLEVEL% EQU 0 GOTO 100
echo - [ECHEC] Changement de rep %REP_WINHLP%  100

GOTO:eof
:100
takeown /f "%systemroot%\winhlp32.exe"
IF %ERRORLEVEL% EQU 0 GOTO 110
echo - [ECHEC] Erreur Appropriation 110

GOTO:eof
:110
icacls "%SystemRoot%\winhlp32.exe" /grant "%UserName%":f
IF %ERRORLEVEL% EQU 0 GOTO 120
echo - [ECHEC] Erreur grant 120

GOTO:eof
:120
IF EXIST "%SystemRoot%\winhlp32.exe.win10" (
  echo - [WARN] le fichier %SystemRoot%\winhlp32.exe.win10 existe deja
  goto 130
)
move "%SystemRoot%\winhlp32.exe" "%SystemRoot%\winhlp32.exe.win10"
IF %ERRORLEVEL% EQU 0 GOTO 130
echo - [ECHEC] Erreur rename 130

GOTO:eof
:130
copy winhlp32.exe "%SystemRoot%\winhlp32.exe"
IF %ERRORLEVEL% EQU 0 GOTO 140
echo - [ECHEC] Erreur copy %SystemRoot%\winhlp32.exe   140

GOTO:eof
:140

echo -  
ECHO -------------------------------------
ECHO -[OK]---- Traitement fini --------
ECHO -------------------------------------

Hors ligne

 

#2 13-12-2020 18:10:45

foon  
N2iGeek + MangasGeek = foon
Award: bf
Lieu: Bonchamp-Lès-Laval
Date d'inscription: 28-02-2007
Messages: 2486
Pépites: 85
Banque: 9,223,372,036,854,776,000

Re: Lancement et lecture des fichiers .HLP des vieux PB sous Win10

000 pepites


Seuls ceux qui ne font rien ne font jamais d'erreurs
http://www.nerdtests.com/images/badge/163124fb7fb459a3.gif

Hors ligne

 

#3 13-12-2020 19:36:15

FlorentP  
Membre Geek
Award: bf
Lieu: Marseille
Date d'inscription: 23-03-2011
Messages: 95
Pépites: 1,422
Banque: 0

Re: Lancement et lecture des fichiers .HLP des vieux PB sous Win10

C'est la qu'on se rend compte que l'aide c'était mieux avant !

Hors ligne

 

#4 16-12-2020 16:47:29

FlorentP  
Membre Geek
Award: bf
Lieu: Marseille
Date d'inscription: 23-03-2011
Messages: 95
Pépites: 1,422
Banque: 0

Re: Lancement et lecture des fichiers .HLP des vieux PB sous Win10

Je viens de me rendre compte que sur PB 11.5 les fichiers d'aide sont aussi en .hlp   

Dernière modification par FlorentP (16-12-2020 16:53:12)

Hors ligne

 

Pied de page des forums

Propulsé par FluxBB 1.2.22