I used Inno Setup installer generator instead of the InstallShield that comes with Visual Studio 6.0.
Inno Setup is free, easy to use(well-documented) and is downloadable at :
http://www.jrsoftware.org/isinfo.php
I followed the steps described in the FAQ link I gave. The environment variables I set up are(Inno script) :
[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: string; ValueName: "CSF_GraphicShr"; ValueData: "{app}\TKOpenGl.dll"; Flags: deletevalue
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: string; ValueName: "MMGT_CLEAR"; ValueData: "1"; Flags: deletevalue
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: string; ValueName: "CSF_MDTVFontDirectory"; ValueData: "{app}\FontMFT"; Flags: deletevalue
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: string; ValueName: "CSF_MDTVTexturesDirectory"; ValueData: "{app}\Textures"; Flags: deletevalue
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: string; ValueName: "CSF_SHMessage"; ValueData: "{app}\SHMessage"; Flags: deletevalue
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: string; ValueName: "CSF_UnitsDefinition"; ValueData: "{app}\UnitsAPI\Units.dat"; Flags: deletevalue
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: string; ValueName: "CSF_UnitsLexicon"; ValueData: "{app}\UnitsAPI\Lexi_Expr.dat"; Flags: deletevalue
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: string; ValueName: "CSF_XSMessage"; ValueData: "{app}\XSMessage"; Flags: deletevalue
The directories I create during set up are (Inno script) :
[Dirs]
Name: "{app}\FontMFT"
Name: "{app}\SHMessage"
Name: "{app}\Textures"
Name: "{app}\UnitsAPI"
Name: "{app}\XSMessage"
{app} stands for the "application's target directory".
The DLLs I copy are :
[Files]
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKFeat.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKBO.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKFillet.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKG2d.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKG3d.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKGeomAlgo.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKGeomBase.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKHLR.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKIGES.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKMath.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKOffset.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKOpenGl.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKPrim.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKService.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKShHealing.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKSTEP.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKTopAlgo.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKV2d.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKV3d.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKXSBase.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKBool.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKBRep.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\win32\dll\TKernel.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\src\UnitsAPI\Lexi_Expr.dat"; DestDir: "{app}\UnitsAPI"
Source: "C:\hd-space\dev\libs\OpenCASCADE5.1\ros\src\UnitsAPI\Units.dat"; DestDir: "{app}\UnitsAPI"
Source: "C:\hd-space\dev\libs\Qt\lib\qt-mt323.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\WINDOWS\SYSTEM32\MSVCRTD.DLL"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\WINDOWS\SYSTEM32\mapi32x.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\WINDOWS\SYSTEM32\MSVCIRT.DLL"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\WINDOWS\SYSTEM32\MSVCIRTD.DLL"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\WINDOWS\SYSTEM32\MSVCP60.DLL"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\WINDOWS\SYSTEM32\MSVCP60D.DLL"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\WINDOWS\SYSTEM32\MSVCRT.DLL"; DestDir: "{app}"; Flags: ignoreversion
You have to indicate the correct paths(instead of "C:\hd-space\dev\libs\OpenCASCADE5.1\...".
The generated setup program is fine, and the installed application works on target PCs, but this is true only for Windows XP. On PCs running Windows NT 4, I still get the same error(see my first question).
I don't know what makes it failed on NT, it is like when launching the installed app, the msvcrt.dll used is the one in c:\WINNT\System32 instead of the one installed with the application.