I am trying to convert an Install .exe file I made with inno-setup to an appx file using the Desktop App Converter from Microsoft. It hangs every time at "Waiting for installer to process to complete inside Isolated Environment".

The command that I am using in Desktop App Converter is:

DesktopAppConverter.exe -Installer "C:\Users\Desktop\Output\setup.exe"              -Destination "C:\Users\Desktop\MyProgram\" -PackageName    "MyProgramApps"  -Publisher "Me"
-Version 0.1.4.0 -MakeAppx -Verbose -InstallerArguments  "/VERYSILENT"  -PackagePublisherDisplayName "MyApps" -PackageDisplayName "MyProgram"   -AppDisplayName "MyProgram" -AppId "MyProgram"

When I run "MyProgram.exe from the command line using "/VERYSILENT" it installs completely silently.

The script from Inno-Setup is:

#define MyAppName "MyProgram"
#define MyAppVersion "0.1.7"
#define MyAppPublisher "MyApps"
#define MyAppExeName "MyProgram.exe"


[Setup]
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputDir=C:\Users\Desktop\Output
OutputBaseFilename=thirteenth_setup
Compression=lzma
SolidCompression=yes


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

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}";        GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked


[Files]

Source: "C:\Users\Desktop\resources\MyProgram.exe"; DestDir: "{app}";  Flags: ignoreversion
#define JavaInstaller "jre-8u151-windows-x64.exe"
Source: "{#JavaInstaller}";  DestDir: "{tmp}"; Flags: dontcopy

[Icons]
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}";  Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; \
Description: "{cm:LaunchProgram,{#StringChange(MyAppName,'&', '&&' )}}"; \
Flags: nowait postinstall skipifsilent



[Code]
const
  REQUIRED_JAVA_VERSION = '1.7';

function isJavaInstalled(): Boolean;
var
  JavaVer : String;
  tmpFileName,
  pathJavaExe: String;
  isGoodJavaVersion,
  isFoundJavaPath: Boolean;
  ResultCode: Integer;
  ExecStdout: AnsiString;
begin

  { *** check in registry }
  { sets variables: }
  {   JavaVer }
  {   isGoodJavaVersion }
  if RegQueryStringValue(HKLM, 'SOFTWARE\JavaSoft\Java Runtime   Environment',
           'CurrentVersion', JavaVer) AND (JavaVer <> '') OR
     RegQueryStringValue(HKLM64, 'SOFTWARE\JavaSoft\Java Runtime Environment',
           'CurrentVersion', JavaVer) AND (JavaVer <> '') then begin
    Log('* Java Entry in Registry present. Version: ' + JavaVer);
    isGoodJavaVersion := CompareStr(JavaVer, REQUIRED_JAVA_VERSION) >= 0;
  end;

  { add additional checks, for example by searching the PATH, }
  { or by running `java -version` }

  Result := isGoodJavaVersion;
end;
procedure ExtractInstaller;
begin
   ExtractTemporaryFile('{#JavaInstaller}');
end;


[Run]
Filename: "{tmp}\{#JavaInstaller}";  Parameters: "SPONSORS=0"; \
   StatusMsg: "Java Runtime Enviroment not installed on your system.  Installing..."; \
   Check: not isJavaInstalled;  BeforeInstall: ExtractInstaller;

I think it has something to do with:

[Run]
Filename: "{tmp}\{#JavaInstaller}";  Parameters: "SPONSORS=0"; \
   StatusMsg: "Java Runtime Enviroment not installed on your system.  Installing..."; \
   Check: not isJavaInstalled;  BeforeInstall: ExtractInstaller;

because when I run it without that 'run' statement then DAC runs to a finish. But of course then the Java installer does not run.

1

There are 1 best solutions below

0
On

You can also convert the packages with the new free Express edition from Advanced Installer, developed in partnership with Microsoft, its purpose is to complement the Desktop App Converter.

For example, the installation of your INNO package can be interactive, with UI, so you can manually run the installer and complete the installation, thus should be able to avoid the above problem.

It has a GUI that allows for advanced customization of the APPX packages, without requiring you to have knowledge about the internals package schemas.

If you have any questions about it, let me know, would love to help.

Disclaimer: I work on the team that builds Advanced Installer.