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
- :
- This is an Installscript project
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
‎Jun 24, 2013
03:02 PM
What do these parameters mean?
I'm trying to use createfile() in a user function. The documentaton has the following snippet:
#define EXAMPLE_DIR "C:\\"
#define EXAMPLE_FILE "ISExampl.txt"
// Include Ifx.h for built-in InstallScript function prototypes.
#include "Ifx.h"
export prototype ExFn_CreateFile(HWND);
function ExFn_CreateFile(hMSI)
STRING szTitle, szMsg;
NUMBER nvFileHandle;
begin
// Set the file mode to append.
OpenFileMode (FILE_MODE_APPEND);
What do the parameters HWND and hMSI represent?
This will be my first user function in IS.
Thanks,
Mel Polatchek
#define EXAMPLE_DIR "C:\\"
#define EXAMPLE_FILE "ISExampl.txt"
// Include Ifx.h for built-in InstallScript function prototypes.
#include "Ifx.h"
export prototype ExFn_CreateFile(HWND);
function ExFn_CreateFile(hMSI)
STRING szTitle, szMsg;
NUMBER nvFileHandle;
begin
// Set the file mode to append.
OpenFileMode (FILE_MODE_APPEND);
What do the parameters HWND and hMSI represent?
This will be my first user function in IS.
Thanks,
Mel Polatchek
- Tags:
- installscript
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 25, 2013
07:45 AM
This example code is for an InstallScript MSI Custom Action. Is that what you are trying to create?
All MSI Custom Actions have an entry point function which has a single argument typically named "hMSI" which is a handle to the MSI install instance that the Custom Action is running in. In InstallScript code a Windows handle is declared as type HWND.
All MSI Custom Actions have an entry point function which has a single argument typically named "hMSI" which is a handle to the MSI install instance that the Custom Action is running in. In InstallScript code a Windows handle is declared as type HWND.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 25, 2013
01:27 PM
This is a modification to an existing Installscript project. The documentation does not say MSI only, I am assuming I can make it work within Installscript as a User Def Function. Thanks for the tip about the handle.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 25, 2013
02:02 PM
The example code where that snippet came from does indicate that it should be used in a MSI custom action.
"Note To call this function in a Basic MSI setup, you must first create a custom action for the entry-point function, execute the custom action in a sequence or as the result of a dialog's control event, and then build the release."
http://kb.flexerasoftware.com/doc/Helpnet/installshield15langref/LangrefCreateFile_Example.htm
I would agree that the above note does not make it clear that the code will not work, as is, in anything other than a MSI custom action, but that is implied.
If your function is not being called in the context of a custom action, then change the function prototype to reflect that there would not be a MSI handle.
#define EXAMPLE_DIR "C:\\"
#define EXAMPLE_FILE "ISExampl.txt"
// Include Ifx.h for built-in InstallScript function prototypes.
#include "Ifx.h"
export prototype My_CreateFile();
function My_CreateFile()
STRING szTitle, szMsg;
NUMBER nvFileHandle;
begin
// Set the file mode to append.
OpenFileMode (FILE_MODE_APPEND);
.....
"Note To call this function in a Basic MSI setup, you must first create a custom action for the entry-point function, execute the custom action in a sequence or as the result of a dialog's control event, and then build the release."
http://kb.flexerasoftware.com/doc/Helpnet/installshield15langref/LangrefCreateFile_Example.htm
I would agree that the above note does not make it clear that the code will not work, as is, in anything other than a MSI custom action, but that is implied.
If your function is not being called in the context of a custom action, then change the function prototype to reflect that there would not be a MSI handle.
#define EXAMPLE_DIR "C:\\"
#define EXAMPLE_FILE "ISExampl.txt"
// Include Ifx.h for built-in InstallScript function prototypes.
#include "Ifx.h"
export prototype My_CreateFile();
function My_CreateFile()
STRING szTitle, szMsg;
NUMBER nvFileHandle;
begin
// Set the file mode to append.
OpenFileMode (FILE_MODE_APPEND);
.....
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)