3

I have a custom action that runs in the very beginning of my Install Shield Project. I check the exit code on this custom action because it is a form that has a next and cancel button, if the user cancels the install should NOT proceed, if they select next it should (thus I check the exit code). However I don't want the user to see an install-Shield error message when they select cancel. Is there anything I can do? I have install shield 2010

hrh
  • 658
  • 1
  • 14
  • 24
  • Also it would be acceptable, however the less prefable option, if I could just change the error message to say "User Cancelled Installation" – hrh Dec 08 '10 at 17:27
  • Also, my custom action is a .exe that i created in c#, im not sure if this information is important. – hrh Dec 08 '10 at 19:52

1 Answers1

4

EXE custom actions can only succeed or fail (zero or non-zero return code). MSI DLL custom actions can set properties (that future actions can condition on), and return one of several status indicators including success, failure, or user cancelled. If you have to use an EXE (say because it was provided to you), you will likely need to wrap it in a MSI DLL custom action to do what you want. Or, if possible, it may be a lot better to rewrite the EXE as a DLL.

Michael Urman
  • 15,737
  • 2
  • 28
  • 44
  • Thanks, ill try to make a MSI DLL custom action, I've never made one so any tips would be appreciated. – hrh Dec 09 '10 at 15:17
  • So I am stuck trying to create a wrapper for my c# windows forms exe. I tried createing a regular DLL that uses CreateProcess to call my exe, then I tried creating a custom action with that dll, but I just get "The DLL being called encountered a problem." I'm not sure what the easiest thing to do is. Really all I want is to have a screen that gives the user some dynamic information at the beginning of the install and then ask if they want to proceed or not. – hrh Dec 09 '10 at 19:59
  • I now figured out how to create a MSI DLL, but am still having problems. If I have my DLL call a simple exe such as "notepad.exe" it works. However if I call the ".exe" I created nothing happens It doesn't run, what could I be doing wrong? – hrh Dec 10 '10 at 17:34
  • Check the return codes. Invoking psychic debugging I'm betting on either a bad path or `ERROR_ELEVATION_REQUIRED`. – Michael Urman Dec 12 '10 at 16:47