2

I 'm currently trying to make an installer for a Windows/WPF application developed in Visual Studio Community 2015 using Inno Setup 5.6.1. The application compiles without any errors in Visual Studio but for some reason it crashes when launched using the installer created with Inno Setup.

Can someone take a look at my process and let me know if I'm following the proper steps or if I'm missing something?

Here is how I created the installer.

  1. In Visual Studio I changed the compile mode from Default to Release.
  2. Compile in Release mode without any errors.
  3. In Inno Setup I created a new script using the Script Wizard, see images below.

Please note that I used the executable compiled in Release mode located in the /bin/Release/ directory.

What am I missing?

This is the error I get when I launch the app using the installer.

enter image description here

View problem details:

Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: MyApp.exe
Problem Signature 02: 0.0.0.1
Problem Signature 03: 5c1b91bb
Problem Signature 04: PresentationFramework
Problem Signature 05: 4.6.1055.0
Problem Signature 06: 563c1d45
Problem Signature 07: f9b
Problem Signature 08: 5b
Problem Signature 09: System.Windows.Markup.XamlParse
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 1033
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt

Inno Script Wizard:

enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

Community
  • 1
  • 1
fs_tigre
  • 10,650
  • 13
  • 73
  • 146
  • 1
    The problem is unlikely caused by the packaging script of `Inno-Setup`. First find out the error message for the crash in Event Viewer. Or click `View Problem Details` in the first image. – kennyzx Dec 26 '18 at 02:02
  • See my edited comment, I'm now showing the View problem details. – fs_tigre Dec 26 '18 at 02:21
  • 1
    Have you copied all the necessary files to the destination folder? First check if you can run the application from bin\Release without a problem, then compare the files in bin\Release with the files in `C:\Program Files\MyApp`. – kennyzx Dec 26 '18 at 02:26
  • Application runs fine from bin\Release. Compared folders, bin\Release contains a lot of .dll files from libraries I'm using in the app (GalaSoftMvvmLight, Newtonsoft.Json) and a few folders, while the C:\Program Files\MyApp folder is completly empty. Do these two folders need to match? If yes, where in Inno Setup do I need to add the files and folders? – fs_tigre Dec 26 '18 at 02:35
  • Yes, those files need to be in the destination folders. See my answer below. – kennyzx Dec 26 '18 at 02:37
  • 2
    See also [Application does not work when installed with Inno Setup](https://stackoverflow.com/q/44333839/850848). – Martin Prikryl Dec 26 '18 at 17:40

1 Answers1

1

The problem is that some files that are necessary to run the app are missing from the destination folder. You need to add them to the Inno-Setup package.

See the 3rd Inno-Setup screencap you provided, use the "Add File(s)" and "Add Folder" buttons.

kennyzx
  • 12,845
  • 6
  • 39
  • 83
  • Do I need to include all folders and files in the bin/Release folder? I see a few folders(de, es, fr, hu, etc) and some .exe.config, .pdb and .xml files. Do I need to include all of them? – fs_tigre Dec 26 '18 at 02:43
  • 1
    Only those necessary. Pdb is for debugging so it doesn’t need to. de, es, fr.. are localization resources so they are needed. For other files, use your own judgement, because they might or might not be needed. – kennyzx Dec 26 '18 at 02:51
  • Got it, thanks a lot for your help. I added all files but not the folders and the installer now works fine, no error. I'm not using localization in my app, do I still need to add them? – fs_tigre Dec 26 '18 at 02:54
  • 1
    If it is intended for English only then they are not required. But adding them is a good step forward, the app may one day be used on non-English systems, who knows? :) Of course since you don’t use localization yet, those de/es/fr dlls are just empty now. – kennyzx Dec 26 '18 at 03:00