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
- :
- Re: write a function who take some parameters !?
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
‎Nov 13, 2007
10:26 AM
write a function who take some parameters !?
Hi,
I work with installshield 2008 and my project is a basic msi project
I have write a fonction test who just return a value
that works if i use this function i can have the result in a messagebox but now
i would like to place this return value in the others function as this for example ;
but when i compile the code that doesn't work at all !
C:\InstallShield 2008 Projects\SQLCONNECT_Insert\script files\setup.rul(84) : error C8003: 'ResultTest' : function has no prototype declaration
C:\InstallShield 2008 Projects\SQLCONNECT_Insert\script files\setup.rul(84) : error C8008: 'STRING' : identifier expected
Is it possible to pass some parameters in a function ?
Thanks in advance
Christophe
I work with installshield 2008 and my project is a basic msi project
I have write a fonction test who just return a value
function string ReturnTest(hMSI)
begin
return "hello";
end;
that works if i use this function i can have the result in a messagebox but now
i would like to place this return value in the others function as this for example ;
function ResultTest(STRING)
begin
//Use the string HERE
end;
but when i compile the code that doesn't work at all !
C:\InstallShield 2008 Projects\SQLCONNECT_Insert\script files\setup.rul(84) : error C8003: 'ResultTest' : function has no prototype declaration
C:\InstallShield 2008 Projects\SQLCONNECT_Insert\script files\setup.rul(84) : error C8008: 'STRING' : identifier expected
Is it possible to pass some parameters in a function ?
Thanks in advance
Christophe
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 13, 2007
10:51 AM
Please see the help topic "Prototyping Functions"; in general, a new function needs two pieces, as in:
If you want to define an InstallScript custom action function, though, please see "Writing Entry-Point Functions". The prototype must be:
and the function body:
To pass additional information back and forth between the installer and your InstallScript function, you'll need to use MsiGetProperty and MsiSetProperty.
prototype int FunctionName(STRING, NUMBER);
function FunctionName(szSomething, nSomethingElse)
STRING temp;
begin
// do something
return 0;
end;
If you want to define an InstallScript custom action function, though, please see "Writing Entry-Point Functions". The prototype must be:
export prototype ActionName(HWND);
and the function body:
function ActionName(hInstall)
begin
// do something
return ERROR_SUCCESS;
end;
To pass additional information back and forth between the installer and your InstallScript function, you'll need to use MsiGetProperty and MsiSetProperty.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 13, 2007
11:38 AM
I just tried this with success -
#include "ifx.h"
export prototype MyFunction(HWND);
export prototype MyFunction2(HWND,STRING);
STRING tmpStr;
function MyFunction(hMSI)
number nvInstallState, nvActionState;
begin
tmpStr = "Message";
MyFunction2(hMSI, tmpStr);
end;
function MyFunction2(hMSI, tmpStr)
begin
MessageBox (tmpStr, 0);
end;
#include "ifx.h"
export prototype MyFunction(HWND);
export prototype MyFunction2(HWND,STRING);
STRING tmpStr;
function MyFunction(hMSI)
number nvInstallState, nvActionState;
begin
tmpStr = "Message";
MyFunction2(hMSI, tmpStr);
end;
function MyFunction2(hMSI, tmpStr)
begin
MessageBox (tmpStr, 0);
end;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 14, 2007
05:46 AM
Hi both,
thanks for you information
That's great
Have a nice day
Christophe
thanks for you information
That's great
Have a nice day
Christophe
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 14, 2007
08:50 AM
Indeed, nice catch 🙂