0

I have an WPF app, that I want to publish using InnoSetup. innoSetup compiles everything without errors. When I run installer, everything is ok and program installs. But then it doesn't run at all. Even with Run as Admin. So I went to the installation folder and tried to run the .exe file under /Debug/ directory and it runs as normal. So I think there is a problem with referenses from between the .exe file that user sees and the .exe file that is the app. The InnoSetup script:

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "WPFApp"
#define MyAppVersion "2.0.0.2"
#define MyAppPublisher "crackanddie"
#define MyAppURL "https://google.com"
#define MyAppExeName "WPFApp.exe"

[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={{4533EDE9-30F2-4EFE-BFC6-F8563749201D}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName=C:\Program Files (x86)\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
; Uncomment the following line to run in non administrative install mode (install for current user only.)
; PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
OutputDir=D:\Downloads\WPFApp
OutputBaseFilename=WPFAppSetup
SetupIconFile=D:\Scripts\MyWPFApp\WPFApp\Images\logo.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern

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

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

[Files]
Source: "D:\Scripts\MyWPFApp\WPFApp\bin\Debug\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Scripts\MyWPFApp\WPFApp\bin\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

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

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

[Dirs]
Name: {app}; Permissions: users-full

What could be the reason of this? Maybe I should change something in my script?

crackanddie
  • 688
  • 1
  • 6
  • 20
  • Why are you using Debug builds? – Dai Jun 11 '22 at 18:00
  • Does this matter? They are the same with files in Release folder – crackanddie Jun 11 '22 at 18:02
  • I am skeptical that your `Debug` and `Release` binaries are identical, quite the opposite: assemblies built in Debug mode will run slower than Release binaries. See here: https://stackoverflow.com/questions/2446027/debug-vs-release-performanc – Dai Jun 11 '22 at 18:03
  • Ok, thanks, I didn't know about that. Anyway it is just a test publish – crackanddie Jun 11 '22 at 18:05
  • 1
    Debug and Release are not the same, your application gets optimised when built in Release mode so that it runs more efficiently. There are also other differences such as differences in the debugging files that are generated, Debug builds usually have a full debugging built in while Release builds usually default to only basic .PDB files. For your source files, make sure your including everything in the build folder. Definitely suggest you change the source path to ```Source: "D:\Scripts\MyWPFApp\WPFApp\bin\Release\*";``` though to use the Release build. – Istalri Skolir Jun 13 '22 at 09:58

1 Answers1

0

I found the solution, it was quite stupid. I just changed path of .dll files to Source: "D:\Scripts\MyWPFApp\WPFApp\bin\Debug\*";

crackanddie
  • 688
  • 1
  • 6
  • 20
  • So you basically didn't have [tag:inno-setup] question in the first place. See [Application does not work when installed with Inno Setup](https://stackoverflow.com/q/44333839/850848). – Martin Prikryl Jun 12 '22 at 17:08