using Desktop App Converter sticks at "Waiting for installer process to complete inside Isolated Environment" - desktop-app-converter

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.

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.

Related

Inno Setup: How to overwrite on install but not on change?

I know how to overwrite the files using this method
[Files]
Source: "Project\*"; DestDir: "{app}"; \
Flags: ignoreversion recursesubdirs onlyifdoesntexist; Permissions: everyone-full
But when I change the program using the Change option in 'Install Or Change Program' section I want to not overwrite the files.
I create the change option for my installer like this:
[setup]
AppModifyPath="{srcexe}" /modify=1
How do I do this?
First, your code seems wrong. With the onlyifdoesntexist flag, the files are never overwritten, contrary to what you claim. So for most purposes, simply using this flag will do.
Anyway, a solution is to create two [Files] entries, one that overwrites and one that does not. And use the Pascal scripting to pick the entry for a respective installation mode.
[Files]
Source: "Project\*"; DestDir: "{app}"; Flags: ... onlyifdoesntexist; Check: IsUpgrade
Source: "Project\*"; DestDir: "{app}"; Flags: ...; Check: not IsUpgrade
Example of IsUpgrade implementation:
[Code]
function IsUpgrade: Boolean;
var
S: string;
InnoSetupReg: string;
AppPathName: string;
begin
InnoSetupReg :=
'Software\Microsoft\Windows\CurrentVersion\Uninstall\{#SetupSetting("AppId")}_is1';
{ The ExpandConstant is here for Inno Script Studio, }
{ which generated AppId in a form of GUID. }
{ The leading { of the GUID has to be doubled in Inno Setup, }
{ and the ExpandConstant collapses that back to single {. }
InnoSetupReg := ExpandConstant(InnoSetupReg);
AppPathName := 'Inno Setup: App Path';
Result :=
RegQueryStringValue(HKLM, InnoSetupReg, AppPathName, S) or
RegQueryStringValue(HKCU, InnoSetupReg, AppPathName, S);
end;
See also Pascal scripting: Check parameters.

Inno Setup Procedure not executing after install

I have compiled multiple programs in inno setup i.e
Sql Server
.Net framework 3.5
Crystal Reports
Sql Script
the problem i am facing is that the procedure in which the code of executing the script is present does not execute after the installation of a program before it. If the program before it is cancelled then it execute.
[Files]
Source: "E:\Inno Data\Inno_Setup\Prerequisites\dotnetfx35\NDP451-KB2858728-x86-x64-AllOS-ENU.exe"; DestDir: {tmp}; AfterInstall: InstallFramework
Source: "E:\Inno_Setup\Prerequisites\CrystalReports105\CRRuntime_64bit_13_0_5.msi"; DestDir: {tmp}; AfterInstall: InstallCrystalReports
Source: "E:\Prerequisites\SQLServer2008R2SP2\SQLEXPRWT_x64_ENU.exe"; DestDir: {tmp}
;SQL Script Files
Source: "E:\SQLInstallTEST\Scripts\RCabSoft.sql"; DestDir:"{app}\Scripts"
[Run]
Filename: "{tmp}\SQLEXPRWT_x64_ENU.exe"; Parameters: "/ACTION=Install /INSTANCENAME=MSSQLSERVER /QS /HIDECONSOLE /INDICATEPROGRESS=""False"" /IAcceptSQLServerLicenseTerms /SQLSVCACCOUNT=""NT AUTHORITY\SYSTEM"" /SQLSYSADMINACCOUNTS=""builtin\users"" /SKIPRULES=""RebootRequiredCheck"" "; Check: isWin64();
Filename: "msiexec.exe"; Parameters: "/i ""{tmp}\CRRuntime_64bit_13_0_5.msi"" /qb"; WorkingDir: {tmp};
Filename: "{tmp}\NDP451-KB2858728-x86-x64-AllOS-ENU.exe"; parameters: "/SILENT /NOCANCEL"; AfterInstall: sqlscript;
[Code]
procedure sqlscript;
var
ResultCode: Integer;
OutputText: String;
begin
if FileExists(ExpandConstant('{pf32}\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\SSMS.exe')) then
begin
ExtractTemporaryFile('RCabSoft.sql');
// Execute SQL Update Scripts
Exec('SqlCmd.exe', ' -e -E -S .' + ExpandConstant(' -i "{tmp}\RCabSoft.sql"'), '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
end;
end;

Create desktop shortcup with inno Setup with custon target

I would like to create a desktop shortcup with inno Setup.
I don't know what i must add into the configuration file of inno Setup to create my custom target.
Here is the line that i want to use :
"%userprofile%\AppData\Local\Google\Chrome SxS\Application\chrome.exe" --app=file://%userprofile%/Desktop/web/index.html --disable-web-security
And here is the content of the script configuration file of inno Setup :
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Icons]
Name: "{commondesktop}\SDK"; Filename: "{app}\index.html"; WorkingDir: "{app}"; IconFilename: {app}\tools\favicon.ico; Tasks: desktopicon
To specify icon parameters there's the Parameters parameter available for [Icons] section entries. The rest remains same as you already used. Just two notes; replace those environment variables by the corresponding path constants given by the Inno Setup scripting engine and be careful when using those variables when you're going to expand a file name with forward slashes (file://%userprofile%/..). Wouldn't such command line parameter fail in app. because it expands the path with baskslashes ?
In this script both mentioned issues should be considered:
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
[Icons]
Name: "{commondesktop}\SDK"; Filename: "{localappdata}\Google\Chrome SxS\Application\chrome.exe"; Parameters: "{code:GetParameters}"
[Code]
function ForwardSlashes(const Value: string): string;
begin
Result := Value;
StringChangeEx(Result, '\', '/', True);
end;
function GetParameters(Value: string): string;
var
S: string;
begin
S := ForwardSlashes(ExpandConstant('file://{userdesktop}/web/index.html'));
Result := Format('--app=%s --disable-web-security', [S]);
end;

The project of Inno Setup for Windows 64-bit

I had created the project via Inno Setup for Windows 64-bit (e.g. Win 7 / 8).
After Installed I have detected that the files of the handbook can not open!
Code of my project the Inno Setup below.
How can I solve it problem?
Where my error in it the project?
#define MyAppName "MyProgram"
#define MyAppVersion "1.0.0"
#define MyAppPublisher "Publish Inc."
#define MyAppURL "http://www.mydomen.com/"
#define MyAppExeName "myprogram.exe"
[Setup]
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
LicenseFile=C:\Users\path_to_my_program\Win64\Debug\license-ru.txt
InfoAfterFile=C:\Users\path_to_my_program\Win64\Debug\readme-ru.txt
OutputDir=C:\Users\Documents\Inno Setup\Setups
OutputBaseFilename=myprogramsetup64
SetupIconFile=C:\Users\path_to_my_program\myprogram_Icon.ico
Compression=lzma2
SolidCompression=yes
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: " {cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "C:\Users\path_to_my_program\Win64\Debug\myprogram.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\path_to_my_program\Win64\Debug\SQLite3.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\path_to_my_program\Win64\Debug\help\handbook-ru.pdf"; DestDir: "{app}\help"; Flags: ignoreversion
Source: "C:\Users\path_to_my_program\Win64\Debug\help\handbook-en.pdf"; DestDir: "{app}\help"; Flags: ignoreversion
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram, {#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
After Installed I can not to open from my program the help files - handbook-ru.pdf and handbook-en.pdf. It is problem.
I had in my program used code:
procedure TForm1.MenuItem1Click(Sender: TObject);
var
path_to_handbook : WideString;
begin
case language of
$0019 : path_to_handbook := 'help\handbook-ru.pdf'; // Russian
$0009 : path_to_handbook := 'help\handbook-en.pdf'; // English
end;
ShellExecuteW(Handle, nil, PWideChar(path_to_handbook), nil, nil, SW_SHOWNORMAL);
end;
In debug and runtime the help files had been to open excellent!
And still...
The program is normally installed only with the rights of the administrator.
If Installed with the administrator right then the help files not open and the my program - working well.
If Installed without the administrator right then the help files open well but the my program - working with errors.
Any ideas how to correct a code in Inno Setup.
Thank you very much.

How to separate a Inno Setup script into multiple files?

I have two setup scripts that share common code. It is possible to refactor them?
One way of doing that is having a file for common code which will be referenced by each script.
Is this possible?
Depending on the version of InnoSetup you are using, you can use an include file. The example below uses three files (main.iss, code.iss, commonfiles.iss):
Main File:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "My Program"
#define MyAppVerName "My Program 1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.exe"
[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=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:\util\innosetup\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
#include "CommonFiles.iss"
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#MyAppName}}"; Flags: nowait postinstall skipifsilent
#include "code.iss"
CommonFiles.iss:
Source: "Common.DLL"; DestDir: "{app}"; Flags: ignoreversion
Code.iss:
[code]
function IsDotNET11Detected(): boolean;
// Indicates whether .NET Framework 1.1 is installed.
var
success: boolean;
install: cardinal;
begin
success := RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v1.1.4322', 'Install', install);
Result := success and (install = 1);
end;
function InitializeSetup(): Boolean;
begin
if not IsDotNET11Detected then begin
MsgBox('This software requires the Microsoft .NET Framework 1.1.'#13#13
'Please use Windows Update to install this version,'#13
'and then re-run the setup program.', mbInformation, MB_OK);
Result := false;
end else
begin
MsgBox('Framework installed',mbInformation, MB_OK);
Result := true;
end
end;

Resources