
gigolojoe1.5524896237547593E12 asked a question.
OnBegin doesn't execute
Hi,
I"m using Installshield 12 demo version.
When I run my test project the OnBegin event doesn't execute.
Below is my source code in setup.rul
Any help will be much appreciated.
Thanks
GJ
////////////////////////////////////////////////////////////////////////////////
//
// This template script provides the code necessary to build an entry-point
// function to be called in an InstallScript custom action.
//
//
// File Name: Setup.rul
//
// Description: InstallShield script
//
////////////////////////////////////////////////////////////////////////////////
// Include Ifx.h for built-in InstallScript function prototypes, for Windows
// Installer API function prototypes and constants, and to declare code for
// the OnBegin and OnEnd events.
include "ifx.h"
include "iswi.h"
// The keyword export identifies MyFunction() as an entry-point function.
// The argument it accepts must be a handle to the Installer database.
export prototype MyFunction(HWND);
// To Do: Declare global variables, define constants, and prototype user-
// defined and DLL functions here.
// To Do: Create a custom action for this entry-point function:
// 1. Right-click on "Custom Actions" in the Sequences/Actions view.
// 2. Select "Custom Action Wizard" from the context menu.
// 3. Proceed through the wizard and give the custom action a unique name.
// 4. Select "Run InstallScript code" for the custom action type, and in
// the next panel select "MyFunction" (or the new name of the entry-
// point function) for the source.
// 5. Click Next, accepting the default selections until the wizard
// creates the custom action.
//
// Once you have made a custom action, you must execute it in your setup by
// inserting it into a sequence or making it the result of a dialog's
// control event.
///////////////////////////////////////////////////////////////////////////////
//
// Function: MyFunction
//
// Purpose: This function will be called by the script engine when
// Windows(TM) Installer executes your custom action (see the "To
// Do," above).
//
///////////////////////////////////////////////////////////////////////////////
function MyFunction(hMSI)
// To Do: Declare local variables.
begin
// To Do: Write script that will be executed when MyFunction is called.
end;
function OnBegin( )
STRING nResult;
begin
if (GetDisk("f",nResult) < 0) then
MessageBox("No f: drive detected, exiting installation",SEVERE);
ExitInstall();
endif;
end;
Hi,
I"m using Installshield 12 demo version.
When I run my test project the OnBegin event doesn't execute.
Below is my source code in setup.rul
Any help will be much appreciated.
Thanks
GJ "
Can you try running it in DEBUG mode and step thru' the code?
I tried running in debug mode but wasn't able to step through the code.
Does it matter that I am using an msi project instead of an installscript project?
I tried using an install script project and installscript\msi project and neither would run my code.
Does the demo version have that feature disabled?
Thanks
Hi Tampaite,
Does it matter that I am using an msi project instead of an installscript project?
Does the demo version have that feature disabled?
Thanks "
It shouldn't matter which project you create. Evaluation version doesn't have DEBUG disabled(I just downloaded a copy and verified it).
Can you just add the below simple messagebox and see if you can step into it?
MessageBox("Hello World", INFORMATION);
Yup, I added that messagebox but it didn't pop up.
Do I have to create a custom action to hook into the setup.rul?
If you would like to use an event driven script, an InstallScript project is the recommended project type.