PDA

View Full Version : EXE in custom actions



NewsArchive
07-03-2001, 12:00 AM
Thanks and sorry about the email address being wrong for my profile. Someone
played around on my system again.

"Solovyov Dmitry" <solodim@mail.ru> wrote in message
news:3b41c575@12.41.20.38...
> See "Your InstallShield Dir\Redistributable\Uncompressed Files\Your
> Language\Intel 32"
> Change the resources in Setup.exe.
>
>

FidoBoy
11-15-2001, 04:14 AM
I've created an EXE file using VB6 and i want that it will be launched just before the uninstallation process of my application. Wat changes must i do in my EXE file to return a exit code? What i want is that if the user cancel my exe file action, the uninstallation process to abort. I only want that uninstallation process continues if my EXE was executed ok. I've readed about exit code in the Custom actions properties, but i don't know how to use it and there is no documentation in the help system. May anybody help me?

Many thanks in advance,

Chandima
11-15-2001, 02:19 PM
To get some idea you can look at the DLL Custom Actions help. The DLL Custom Action has two types and there are code samples for both. Both samples show how to stop the install based on users response. If you just copy the sample to a C++ project build and run them during uninstall, it stops the uninstall.

FidoBoy
11-15-2001, 02:55 PM
Ok, but i want to use an EXE not a DLL. And i use Visual Basic for development... I have no idea of C

Greetings,

Fido

Chandima
11-16-2001, 09:20 AM
You can buid the exe in VB. The code sample should just give you an idea of the Msi Api to call, return values and some basic logic.

FidoBoy
11-19-2001, 02:23 PM
Ok, but how can i return a value from my EXE file? Can u give me a small sample or where can i get samples about this issues?

johram
11-20-2001, 09:11 AM
Check out the API function ExitProcess which you can declare in VB like this:

Declare Sub ExitProcess Lib "kernel32" (ByVal procExitCode As Long)

Then you can use it to return a value from your Visual Basic application. A return value of 0 is considered OK, all other values is interpreted as a failure (as far as I have understood).

Don't forget that if you run the code in Visual Studio, the entire VB IDE will shut down ;-) which might not always be what U want. So only try the code in the EXE (unless you like to restart VB :-)

Good luck!

FidoBoy
11-20-2001, 11:20 AM
Ok, i'll try it with InstallShield. I'll tell you if it works fine...

Thanks, ;D

FidoBoy
11-21-2001, 03:26 AM
Great! It works perfectly but there is an small inconvenience that i don't know how to solve... When my program closes with any code different from 0 the installer do not exit inmediately, it shows a message saying that there is a trouble with a program and then it aborts. Can i supress that warning??