0

I am new to InnoSetup coding. I'm trying to install an old Visual Basic 6 program on a bunch of Windows 10 pro machines. On half the machines, the installation works and the program runs successfully. However, on the other machines, the installation is successful, but the program does not run. The program interface looks like this:

bad interface

when it should look like this:

good interface

Here is a copy of my installation code:

#define MyAppName "Winapex 1501"
#define MyAppVersion "1.0"
#define MyAppPublisher "Blackland Research Center"
#define MyAppURL "http://blackland.tamu.edu/"
#define MyAppExeName "WinApex.exe"
#define MyAppIcoName "WinAPEX_2.ico"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{5B7299DB-CD69-41AD-AF8A-D82B4E37E676}
AppName={#MyAppName}
AppVersion={#MyAppVersion} 
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
UsePreviousAppDir=no
DefaultDirName=C:\APEX\WinAPEX1501
DisableProgramGroupPage=yes
OutputBaseFilename=Winapex1501setup64
Compression=lzma
SolidCompression=yes
DisableWelcomePage=no
DisableDirPage=no
CreateAppDir=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1

[Files]

Source: "D:\WinAPEX1501\WinApex.exe"; DestDir: "{app}"; Flags: ignoreversion  
Source: "D:\WinAPEX1501\WinAPEXpath.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\WinAPEX1501\WinAPEXpath.txt";  DestDir: "C:\Program Files\"; Flags: ignoreversion

Source: "D:\OneDrive - agnet.tamu.edu\Documents\WinAPEX 1501 install\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

; NOTE: Don't use "Flags: ignoreversion" on any shared system files

; begin VB system files
; (Note: Scroll to the right to see the full lines!)
Source: "D:\Winapex JayHawk\WinAPEX\vbfiles\stdole2.tlb";  DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regtypelib
Source: "D:\Winapex JayHawk\WinAPEX\vbfiles\msvbvm60.dll"; DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\vbfiles\oleaut32.dll"; DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\vbfiles\olepro32.dll"; DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\vbfiles\asycfilt.dll"; DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile
Source: "D:\Winapex JayHawk\WinAPEX\vbfiles\comcat.dll";   DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver

Source: "D:\Winapex JayHawk\WinAPEX\vbfiles\dbadapt.dll";   DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\vbfiles\MSBind.dll";   DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\vbfiles\MSDbRptr.dll";   DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\vbfiles\msrdo20.dll";   DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\vbfiles\MSSTDFMT.DLL";   DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\vbfiles\msstkprp.dll";   DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver
// Source: "D:\Winapex JayHawk\WinAPEX\vbfiles\comdlg32.dll";   DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver
; end VB system files

; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Source: "D:\Winapex JayHawk\WinAPEX\ComDlg32.ocx"; DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\MSFlxGrd.ocx"; DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\Resize32.ocx"; DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\richtx32.ocx"; DestDir: "{sys}"; Flags: restartreplace sharedfile regserver

Source: "D:\Winapex JayHawk\WinAPEX\ComCt232.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\comct332.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\comctl32.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
; Source: "D:\Winapex JayHawk\WinAPEX\dbadapt.dll";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\dbgrid32.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\dblist32.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\mci32.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\msadodc.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
; Source: "D:\Winapex JayHawk\WinAPEX\msbind.dll";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\mschrt20.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\mscomct2.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\mscomctl.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\mscomm32.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\msdatgrd.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\msdatlst.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\msdatrep.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
; Source: "D:\Winapex JayHawk\WinAPEX\msdbrptr.dll";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\mshflxgd.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\msinet.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\msmapi32.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\msmask32.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\msrdc20.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
; Source: "D:\Winapex JayHawk\WinAPEX\msrdo20.dll";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
; Source: "D:\Winapex JayHawk\WinAPEX\msstdfmt.dll";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
; Source: "D:\Winapex JayHawk\WinAPEX\msstkprp.dll";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\comct232.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\mswinsck.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\picclp32.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\sysinfo.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
Source: "D:\Winapex JayHawk\WinAPEX\tabctl32.ocx";   DestDir: "{sys}"; Flags: restartreplace sharedfile regserver

Source: "D:\Winapex JayHawk\WinAPEX\dependencies\NDP462-KB3151800-x86-x64-AllOS-ENU.exe"; DestDir: {tmp}; Flags: deleteafterinstall; AfterInstall: InstallFramework; Check: FrameworkIsNotInstalled

[Code]
function FrameworkIsNotInstalled: Boolean;
begin
  Result := not RegKeyExists(HKEY_LOCAL_MACHINE, 'Software\Microsoft\.NETFramework\policy\v4.0');
end;

procedure InstallFramework;
var
  StatusText: string;
  ResultCode: Integer;

begin
  StatusText := WizardForm.StatusLabel.Caption;
  WizardForm.StatusLabel.Caption := 'Installing .NET framework...';
  WizardForm.ProgressGauge.Style := npbstMarquee;
  try
    begin
      if not Exec(ExpandConstant('{tmp}\NDP462-KB3151800-x86-x64-AllOS-ENU.exe'), '/q /norestart', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
        begin
        // you can interact with the user that the installation failed
        MsgBox('.NET installation failed with code: ' + IntToStr(ResultCode) + '.',
          mbError, MB_OK);
        end;
    end;
  finally
    WizardForm.StatusLabel.Caption := StatusText;
    WizardForm.ProgressGauge.Style := npbstNormal;
  end;
end;

function CreateBatch(): boolean;
var
  fileName : string;
  lines : string;
begin
  Result := true;


 
  // fileName := ExpandConstant('{app}\directory.txt');    
  fileName := ExpandConstant('C:\Program Files\WinAPEXpath.txt'); 
  lines := ExpandConstant('{app}');    
  Result := SaveStringToFile(filename,lines,false);   
  exit;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if  CurStep=ssPostInstall then
    begin
         CreateBatch();
    end
end;




[Icons]
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\{#MyAppIcoName}"  
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
; Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\{#MyAppIcoName}"; Tasks: desktopicon
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\{#MyAppIcoName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
GSerg
  • 76,472
  • 17
  • 159
  • 346
iffireno
  • 9
  • 2
  • 1
    A few questions: - Is the "Bad" interface the result of a missing component or missing configuration or something else? - What's common about the machines where it fails? For example, are they all 32 bit or 64 bit Operating Systems? - Can you register the OCX files manually (or some other process) and get it working? If so, what is the process? – mirtheil Aug 17 '20 at 19:33
  • All the machines have the same operation system. I believe you are correct in that I have a missing ocx or dll component on the machine where the program fails. But how do I find it? By comparing all components in the c:\windows\syswow64 directories of the machine that the program works to the one where it doesn't? All the components in my inno setup installation are being installed and work correctly. – iffireno Aug 17 '20 at 20:40
  • 1
    You'll probably need to check each component individually. Go through your InnoSetup file and register each one just like the InnoSetup installer does. Starting the app after each component. You could also check the log for the InnoSetup to see if there are any errors. You didn't answer the question about the app itself. How does it get to the "bad" screen vs the "good" screen. One thing I noticed is that on the Good screen, an "MDB" is listed but on the "bad" one, there isn't. This may not be an InnoSetup issue after all. – mirtheil Aug 17 '20 at 23:02
  • See also [Application does not work when installed with Inno Setup](https://stackoverflow.com/q/44333839/850848). – Martin Prikryl Aug 18 '20 at 06:37
  • Does the installer record a log? If so, any differences between good/bad machines? – StayOnTarget Aug 18 '20 at 11:41
  • 1
    Another approach to debugging the installer is to use Process Monitor to record what the installer is doing on both good & bad PCs. Then you can compare and see what differs. The logs from Proc Mon do include a ton of info... but its often the detail which is helpful. – StayOnTarget Aug 18 '20 at 11:44
  • 2
    @UuDdLrLrSs I would not expect that there's anything wrong with the installer. It's rather that the installer does not install/setup everything that is needed for the application. And the machines where the application work, had that *thing* present before already. – Martin Prikryl Aug 18 '20 at 12:08
  • @MartinPrikryl Logging the installer may show, among other things, if DLL / OCX components are failing to be copied or registered correctly. – StayOnTarget Aug 18 '20 at 12:09
  • I think that Martin is correct. The IS installer is only doing what it's instructed; the OP needs to build it such that all dependencies are correctly included and installed. This has nothing to do with IS _per se_ but rather that the OP needs to actually understand the detail of the application in order to build a correct installer. That's not a question we can answer here (we didn't build the application). – Bill_Stewart Aug 18 '20 at 15:58
  • @Bill_Stewart I'm not assuming the installer is or isn't at fault. I'm suggesting the first order of business is to diagnose what is actually failing. Since it varies between PCs, it stands to reason that something might not be installed correctly. So logging or otherwise seeing what might be going wrong during installation seems like a good diagnostic first step. – StayOnTarget Aug 18 '20 at 16:01
  • Whether the installer is or isn't at fault depends on whether the OP is installing everything needed for the application. Martin's other answer (linked in comments above) is a good idea to determine what exactly the application needs to run correctly. Once you know that, you can fix the installer. – Bill_Stewart Aug 18 '20 at 16:07
  • @Bill_Stewart I agree, that's a good place to start. – StayOnTarget Aug 18 '20 at 16:08
  • The pictures of the good screen and the bad screen show what happens when the program loads the initial screen. These are both pictures of the same initial screen. – iffireno Aug 19 '20 at 14:31
  • While I did not create the program, I do have access to the source code. I have found all the references to all the dll's and ocx's that the program uses and included them in the installation program. – iffireno Aug 19 '20 at 14:33
  • I am now going to see if I can make my inno setup installation program create a log. – iffireno Aug 19 '20 at 14:34
  • Have you analyzed the dependency-walker on the erroneous machines? https://www.dependencywalker.com/ It will show you if there are missing dll's or ocx-es. – Erik Oct 08 '20 at 22:24
  • @Erik the original venerated DependencyWalker is apparently now well out of date, but https://github.com/lucasg/Dependencies is around instead – StayOnTarget Oct 08 '20 at 22:25

0 Answers0