Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

InstallScript custom action not working.

41 views
Skip to first unread message

Manish Aggarwal

unread,
Oct 7, 2001, 2:41:33 AM10/7/01
to
Hi,
I added sample install script from ISWI help (see below) to my install. Then
created a custom action using the wizard (Type: 65536, Source: Test, Target:
<blank>, Comments: Test).
Then I added DoAction to the event control for the next button on the
InstallWelcome dialog. I built the project and ran it, I did not see the
message dialogs. The moment I click next it goes to finish and the setup
fails. I also tried to have the simplest install script code and it fails
too (just MessageBox function call). Am I doing something wrong here?
Thanks!
M

-----------------------Install script
code---------------------------------------------------
// Include Isrt.h for built-in InstallScript function prototypes.
#include "isrt.h"

// Include Iswi.h for Windows Installer API function prototypes and
constants.
#include "iswi.h"
#include "isMsiQuery.h"

export prototype Test(HWND);

function Test(hMSI)
STRING szKey, svValue, svPath;
NUMBER nvType, nvSize, nReturn;
begin
RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);

szKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App
Paths\\iside.exe";
nReturn = RegDBGetKeyValueEx (szKey, "Path", nvType, svValue, nvSize);

// The App Paths key contains the folder where InstallShield was
// installed, followed by a semicolon.
StrSub (svPath, svValue, 0, StrFind(svValue, ";"));

if nReturn = 0 then
MessageBox ("InstallShield is installed to " + svPath, INFORMATION);
return ERROR_SUCCESS;
else
MessageBox ("Cannot determine where InstallShield is installed.",
SEVERE);
return ERROR_INSTALL_FAILURE;
endif;
end;

0 new messages