This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Functions and .rul
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 19, 2008
11:39 AM
Functions and .rul
I've created a .rul file (pure installscript installer) which contains 4 functions all involving NT service piece, like finding if a service is running. I've included the .rul name in my main setup.rul and am trying to use one of the functions in the setup.rul file. I keep getting an error that the function is undefined. Not sure what I'm missing...
The .ruls are
In Setup.rul
#include "StopService.rul"
#include "uninstall.rul"
Trying to call a function:
Error is Undefined Identifier on ServiceConnections
Any ideas?
Thanks
The .ruls are
Setup.rul
StopService.rul
uninstall.rul
In Setup.rul
#include "StopService.rul"
#include "uninstall.rul"
Trying to call a function:
function StopDerby()
string szServiceName,nvServiceState;
NUMBER nResult;
begin
szServiceName = "sl-derby.exe";
end;
string szServiceName,nvServiceState;
NUMBER nResult;
begin
szServiceName = "sl-derby.exe";
ServiceConnections(szServiceName); //From StopService.rul
end;
Error is Undefined Identifier on ServiceConnections
Any ideas?
Thanks
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 19, 2008
05:15 PM
As a sanity check, are those #include lines at the top of setup.rul?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 20, 2008
08:40 AM
Where are the functions prototyped? They need to be declared before they are called in your code.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 20, 2008
09:08 AM
Hello,
Esiemiat is correct. Where are your prototypes? The file arrangement and code should look something like this.
In StopService.rul
In Setup.rul
Esiemiat is correct. Where are your prototypes? The file arrangement and code should look something like this.
In StopService.rul
///////////////////////////////////////////////////////////////////////////////
// StopService.rul //
///////////////////////////////////////////////////////////////////////////////
// Prototype Area //
///////////////////////////////////////
prototype StopDerby();
///////////////////////////////////////////////////////////////////////////////
// StopDerby //
///////////////////////////////////////////////////////////////////////////////
function StopDerby()
string szServiceName,nvServiceState;
NUMBER nResult;
begin
szServiceName = "sl-derby.exe";
ServiceConnections(szServiceName); //From StopService.rul
end;
In Setup.rul
#include "StopService.rul"
#include "uninstall.rul"
function OnFirstUIBefore()
begin
StopDerby();
end;