1

I've used the script from this thread: Run exe after msi installation? respectively this site: Mailbag: How can I customize an MSI in the Visual Studio setup/deployment project?

The checkbox on the finished dialog shows up but my application doesn't start after pressing finish. Nothing happens.

I've tried different lines:

sql = "INSERT INTO `CustomAction` (`Action`, `Type`, `Source`, `Target`) VALUES ('VSDCA_Launch', '210', '" + fileId + "', '')";

or

sql = "INSERT INTO `CustomAction` (`Action`, `Type`, `Source`, `Target`) VALUES ('VSDCA_Launch', '226', 'TARGETDIR', 'MyProgram.exe')";

Any ideas or is it possible to debug the script or write a log with further informations to find out what exactly doesn't work? The application need administrator rights. Does this matter?

user1673665
  • 516
  • 3
  • 8
  • 21

1 Answers1

1

Formatted: The fact that notepad.exe works probably means that you need a full path (notepad.exe is in the system path and can hence be invoked without a path, other binaries need full path).

Did you try to do [#filekey] as in [#MyProgram.exe] as value in the Target field? The reference must match a File table entry. So look in the first column of the File table to determine what the file identifier is, and use that in the Target field.

Check out the documentation for Formatted.

WiX?: By the way, is it an option to migrate to WiX? Not to annoy you, but there are some major problems with Visual Studio Projects for long term use. Maybe give it a quick skim.

File Table:

File Table

Shortcut Table:

Shortcut Table


Leaving original answer below:


Quick Test: Maybe first check this: What VSDCA_Launch mean in Custom Action script


Logging: Have you enabled logging to determine what is going on? Please check the Logging section in this answer for a quick "how to".

Dry Run: I suppose you could slipstream notepad.exe in there instead of your own executable to see if it launches OK when admin rights are not required. All you need is a test build and a test run.

Incomplete: I am betting you have forgotten something when post processing the MSI though. My guess is a simple formatting issues such as described by the post linked above.

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • The advice with notepad is interesting, because notepad starts without any problems. But when I put notepad2.exe into the target dir it doesn't start. Apparently the directory can't be found. – user1673665 Sep 18 '18 at 09:31
  • I'll have a look at Wix. Would you prefer it over InnoSetup? – user1673665 Sep 18 '18 at 14:43
  • Certainly. Much better for corporate / silent deployment - provided you keep it simple and standardized. How big is the package? – Stein Åsmul Sep 18 '18 at 14:54
  • Do you mean the filesize of the created setupfile? This is currently 70 MB. – user1673665 Sep 18 '18 at 14:58
  • WiX is a bit fiddly, but it has everything you need in terms of flexibility. Other than that I tend to bug people with these two links of mine: [List of MSI Tools](https://stackoverflow.com/a/50229840/129130). [Deployment Tools](https://stackoverflow.com/a/49632260/129130). For some reason a rather messy answer of mine has been upvoted on the topic of: ["WiX Quick Start"](https://stackoverflow.com/a/25005864/129130). – Stein Åsmul Sep 18 '18 at 15:02
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/180276/discussion-between-stein-asmul-and-user1673665). – Stein Åsmul Sep 18 '18 at 15:03