PDA

View Full Version : Editing AdminAskPath



NewsArchive
12-04-2001, 01:00 AM
AdminAskPath uses the AskPath dialog with different text. So you could
modify the AskPath dialog, if modifying it doesn't interfere somewhere else
in your setup. If so, you can just create a new dialog and modify the
AdminAskPath code so it calls your new dialog (resource) instead of the
existing AskPath.

If you have 7.01, then you have the source code for both AdminAskPath and
AskPath--look for AdminAskPath.rul and AskPath.rul. You can just copy the
AdminAskPath function call into your setup.rul. Then modify that function
call in your setup.rul. That will effectively override the AdminAskPath
function call in Iswi.obl. Similarly with AskPath in Isrt.obl.

Hope that helps.

Kent

"Tony Patterson" <Tony.Patterson@treasury.sungard.com> wrote in message
news:3c0d48fc@news.installshield.com...
> Hi,
>
> Is it possible to edit the AdminAskPath dialog, or at least view the code
> that runs it? I need to be able to either customise this dialog or provide
a
> custom dialog of my own with similar functionality.
>
> Cheers,
> Tony
>
>

NewsArchive
12-05-2001, 01:00 AM
Hi,

Is it possible to edit the AdminAskPath dialog, or at least view the code
that runs it? I need to be able to either customise this dialog or provide a
custom dialog of my own with similar functionality.

Cheers,
Tony

NewsArchive
12-05-2001, 01:00 AM
Thanks a lot Kent, that did indeed help ^^.

I have added the AdminAskPath function to my steup.rul and have customised
that to perform what needs to be done. However, when I went to compile the
script, it complained bitterly about not being able to find three header
files: StrPriv.h, PthPriv.h, and DialogsPriv.h. I searched my hard drive and
indeed was unable to locate these. I'm not too sure where to go from here...
^^;

Cheers

Tony

"Kent Foyer" <kent@installshield.com> wrote in message
news:3c0d5c22$1@news.installshield.com...
> AdminAskPath uses the AskPath dialog with different text. So you could
> modify the AskPath dialog, if modifying it doesn't interfere somewhere
else
> in your setup. If so, you can just create a new dialog and modify the
> AdminAskPath code so it calls your new dialog (resource) instead of the
> existing AskPath.
>
> If you have 7.01, then you have the source code for both AdminAskPath and
> AskPath--look for AdminAskPath.rul and AskPath.rul. You can just copy the
> AdminAskPath function call into your setup.rul. Then modify that function
> call in your setup.rul. That will effectively override the AdminAskPath
> function call in Iswi.obl. Similarly with AskPath in Isrt.obl.
>
> Hope that helps.
>
> Kent
>
> "Tony Patterson" <Tony.Patterson@treasury.sungard.com> wrote in message
> news:3c0d48fc@news.installshield.com...
> > Hi,
> >
> > Is it possible to edit the AdminAskPath dialog, or at least view the
code
> > that runs it? I need to be able to either customise this dialog or
provide
> a
> > custom dialog of my own with similar functionality.
> >
> > Cheers,
> > Tony
> >
> >
>
>

NewsArchive
12-05-2001, 01:00 AM
Sorry Tony,

This is my mistake. Try this. No need to add all the #include in your
setup.rul.

////////////////////////////////////////////////////////////////////////////
/
//
// File Name: Setup.rul
//
// Description: InstallShield script
//
// Comments: This minimal project is intended for advanced users.
// To create a robust project with step-by-step
// instructions, use the Project Wizard.
//
////////////////////////////////////////////////////////////////////////////
/

// Include header files
/////////////////////////////////////////////////////
#include "ifx.h"

external prototype StrRemoveSpaces(BYREF STRING);
external prototype PthFixPath(BYREF STRING, BOOL);
external prototype PthIsAbsPath(BYVAL STRING);

//This is in _isres.dll so let's use it
#define DLG_STR_TXT_INSTALL 11061

#define NDLG_PBUT_OK 1

// private constants
#define DLG_ASKPATH "AskPath"
#define DLG_ASKPATH_ID 10103
#define EDIT_TEXT 4
#define STATIC_TEXT 901

// private globals
NUMBER g_nDlgAskPath;


string svResultPath;

program
AdminAskPath("", "C:\\", svResultPath);
endprogram

function AdminAskPath(szMsg, szDefPath, svResultPath)
STRING szAppKey, svDir, szTitle, szNil, szNewCaption;
NUMBER nId, nTemp, nLen, nNil;
BOOL bDone;
HWND hDlg, hEdit;
begin
// record data produced by this dialog
if (MODE = SILENTMODE) then
SdMakeName(szAppKey, DLG_ASKPATH, "", g_nDlgAskPath);
SilentReadData(szAppKey, "Result", DATA_NUMBER, szNil, nId);
if ((nId != BACK) && (nId != CANCEL)) then
SilentReadData(szAppKey, "szPath", DATA_STRING, svResultPath,
nNil);
endif;
return nId;
endif;

// ensure general initialization is complete
if (!bSdInit) then
SdInit();
endif;

if (EzDefineDialog(DLG_ASKPATH, "", "", DLG_ASKPATH_ID) = DLG_ERR) then
return ISERR_GEN_FAILURE;
endif;

// Loop in dialog until the user selects a standard button
bDone = FALSE;

while (!bDone)
nId = WaitOnDialog(DLG_ASKPATH);

switch (nId)
case DLG_INIT:
CtrlSetText(DLG_ASKPATH, EDIT_TEXT, szDefPath);

nLen = StrLengthChars(svResultPath);
if (nLen = 0) then
Resize(svDir, MAX_PATH);
nLen = Resize(svResultPath, MAX_PATH);
endif;
svDir = szDefPath;

hDlg = CmdGetHwndDlg(DLG_ASKPATH);
SdGeneralInit(DLG_ASKPATH, hDlg, 0, szSdProduct);

if (szMsg != "") then
CtrlSetText(DLG_ASKPATH, STATIC_TEXT, szMsg);
else
szMsg = SdLoadString(ISWI_DLG_ADMINASKPATH_MSG);
CtrlSetText(DLG_ASKPATH, STATIC_TEXT, szMsg);
//force in Product name into text field
SdPlugInProductName(DLG_ASKPATH, hDlg, szSdProduct, STATIC_TEXT, 2);
endif;

hEdit = GetDlgItem(hDlg, EDIT_TEXT);
if (nLen < (MAX_PATH-1)) then
nLen = MAX_PATH - 1;
endif;
SendMessage(hEdit, EM_LIMITTEXT, nLen-2, 0);

//szTitle = GetDialogTitle(DLG_ASK_PATH);
szTitle = SdLoadString(ISWI_DLG_ADMINASKPATH_TITLE);
SdSetDlgTitle(DLG_ASKPATH, hDlg, szTitle);

szNewCaption = SdLoadString(DLG_STR_TXT_INSTALL);
if (szNewCaption != "") then
szNewCaption = "&" + szNewCaption;
CtrlSetText(DLG_ASKPATH, NDLG_PBUT_OK, szNewCaption);
endif;

case SD_PBUT_BROWSE:
CtrlGetText(DLG_ASKPATH, EDIT_TEXT, svDir);
StrRemoveSpaces(svDir);
SelectDir("", "", svDir, TRUE);
CtrlSetText(DLG_ASKPATH, EDIT_TEXT, svDir);

case SD_PBUT_CONTINUE:
CtrlGetText(DLG_ASKPATH, EDIT_TEXT, svDir);
StrRemoveSpaces(svDir);
ParsePath(szNil, svDir, PATH);
if (szNil != svDir) then
PthFixPath(svDir, PthIsAbsPath(svDir));
endif;

svResultPath = svDir;
nId = NEXT;
bDone = TRUE;

case SD_PBUT_BACK:
nId = BACK;
bDone = TRUE;

case DLG_ERR:
nId = ISERR_GEN_FAILURE;
SdError(nId, DLG_ASKPATH);
bDone = TRUE;

case DLG_CLOSE:
SdCloseDlg(hDlg, nId, bDone);

default:
// check standard handling
if (SdIsStdButton(nId) && SdDoStdButton(nId)) then
if (nId != EDIT_TEXT) then
bDone = TRUE;
endif;
endif;
svResultPath = svDir;
endswitch;
endwhile;

EndDialog(DLG_ASKPATH);
ReleaseDialog(DLG_ASKPATH);

SdUnInit();

// record data produced by this dialog
if (MODE = RECORDMODE) then
SdMakeName(szAppKey, DLG_ASKPATH, "", g_nDlgAskPath);
SilentWriteData(szAppKey, "szPath", DATA_STRING, svResultPath,
nNil);
SilentWriteData(szAppKey, "Result", DATA_NUMBER, szNil, nId);
endif;

return nId;
end;

"Tony Patterson" <Tony.Patterson@treasury.sungard.com> wrote in message
news:3c0da21d@news.installshield.com...
> Thanks a lot Kent, that did indeed help ^^.
>
> I have added the AdminAskPath function to my steup.rul and have customised
> that to perform what needs to be done. However, when I went to compile the
> script, it complained bitterly about not being able to find three header
> files: StrPriv.h, PthPriv.h, and DialogsPriv.h. I searched my hard drive
and
> indeed was unable to locate these. I'm not too sure where to go from
here...
> ^^;
>
> Cheers
>
> Tony
>
> "Kent Foyer" <kent@installshield.com> wrote in message
> news:3c0d5c22$1@news.installshield.com...
> > AdminAskPath uses the AskPath dialog with different text. So you could
> > modify the AskPath dialog, if modifying it doesn't interfere somewhere
> else
> > in your setup. If so, you can just create a new dialog and modify the
> > AdminAskPath code so it calls your new dialog (resource) instead of the
> > existing AskPath.
> >
> > If you have 7.01, then you have the source code for both AdminAskPath
and
> > AskPath--look for AdminAskPath.rul and AskPath.rul. You can just copy
the
> > AdminAskPath function call into your setup.rul. Then modify that
function
> > call in your setup.rul. That will effectively override the AdminAskPath
> > function call in Iswi.obl. Similarly with AskPath in Isrt.obl.
> >
> > Hope that helps.
> >
> > Kent
> >
> > "Tony Patterson" <Tony.Patterson@treasury.sungard.com> wrote in message
> > news:3c0d48fc@news.installshield.com...
> > > Hi,
> > >
> > > Is it possible to edit the AdminAskPath dialog, or at least view the
> code
> > > that runs it? I need to be able to either customise this dialog or
> provide
> > a
> > > custom dialog of my own with similar functionality.
> > >
> > > Cheers,
> > > Tony
> > >
> > >
> >
> >
>
>

NewsArchive
12-06-2001, 01:00 AM
Thanks Kent ^^

One more question. In a standard project, is there a dialog available like
the CustomSetup dialog in a basic msi package? One which allows you to
change how a feature is being installed.. from source of from local.

Cheers
Tony


"Kent Foyer" <kent@installshield.com> wrote in message
news:3c0e7917$1@news.installshield.com...
> Sorry Tony,
>
> This is my mistake. Try this. No need to add all the #include in your
> setup.rul.
>
>
////////////////////////////////////////////////////////////////////////////
> /
> //
> // File Name: Setup.rul
> //
> // Description: InstallShield script
> //
> // Comments: This minimal project is intended for advanced users.
> // To create a robust project with step-by-step
> // instructions, use the Project Wizard.
> //
>
////////////////////////////////////////////////////////////////////////////
> /
>
> // Include header files
> /////////////////////////////////////////////////////
> #include "ifx.h"
>
> external prototype StrRemoveSpaces(BYREF STRING);
> external prototype PthFixPath(BYREF STRING, BOOL);
> external prototype PthIsAbsPath(BYVAL STRING);
>
> //This is in _isres.dll so let's use it
> #define DLG_STR_TXT_INSTALL 11061
>
> #define NDLG_PBUT_OK 1
>
> // private constants
> #define DLG_ASKPATH "AskPath"
> #define DLG_ASKPATH_ID 10103
> #define EDIT_TEXT 4
> #define STATIC_TEXT 901
>
> // private globals
> NUMBER g_nDlgAskPath;
>
>
> string svResultPath;
>
> program
> AdminAskPath("", "C:\\", svResultPath);
> endprogram
>
> function AdminAskPath(szMsg, szDefPath, svResultPath)
> STRING szAppKey, svDir, szTitle, szNil, szNewCaption;
> NUMBER nId, nTemp, nLen, nNil;
> BOOL bDone;
> HWND hDlg, hEdit;
> begin
> // record data produced by this dialog
> if (MODE = SILENTMODE) then
> SdMakeName(szAppKey, DLG_ASKPATH, "", g_nDlgAskPath);
> SilentReadData(szAppKey, "Result", DATA_NUMBER, szNil, nId);
> if ((nId != BACK) && (nId != CANCEL)) then
> SilentReadData(szAppKey, "szPath", DATA_STRING, svResultPath,
> nNil);
> endif;
> return nId;
> endif;
>
> // ensure general initialization is complete
> if (!bSdInit) then
> SdInit();
> endif;
>
> if (EzDefineDialog(DLG_ASKPATH, "", "", DLG_ASKPATH_ID) = DLG_ERR)
then
> return ISERR_GEN_FAILURE;
> endif;
>
> // Loop in dialog until the user selects a standard button
> bDone = FALSE;
>
> while (!bDone)
> nId = WaitOnDialog(DLG_ASKPATH);
>
> switch (nId)
> case DLG_INIT:
> CtrlSetText(DLG_ASKPATH, EDIT_TEXT, szDefPath);
>
> nLen = StrLengthChars(svResultPath);
> if (nLen = 0) then
> Resize(svDir, MAX_PATH);
> nLen = Resize(svResultPath, MAX_PATH);
> endif;
> svDir = szDefPath;
>
> hDlg = CmdGetHwndDlg(DLG_ASKPATH);
> SdGeneralInit(DLG_ASKPATH, hDlg, 0, szSdProduct);
>
> if (szMsg != "") then
> CtrlSetText(DLG_ASKPATH, STATIC_TEXT, szMsg);
> else
> szMsg = SdLoadString(ISWI_DLG_ADMINASKPATH_MSG);
> CtrlSetText(DLG_ASKPATH, STATIC_TEXT, szMsg);
> //force in Product name into text field
> SdPlugInProductName(DLG_ASKPATH, hDlg, szSdProduct, STATIC_TEXT, 2);
> endif;
>
> hEdit = GetDlgItem(hDlg, EDIT_TEXT);
> if (nLen < (MAX_PATH-1)) then
> nLen = MAX_PATH - 1;
> endif;
> SendMessage(hEdit, EM_LIMITTEXT, nLen-2, 0);
>
> //szTitle = GetDialogTitle(DLG_ASK_PATH);
> szTitle = SdLoadString(ISWI_DLG_ADMINASKPATH_TITLE);
> SdSetDlgTitle(DLG_ASKPATH, hDlg, szTitle);
>
> szNewCaption = SdLoadString(DLG_STR_TXT_INSTALL);
> if (szNewCaption != "") then
> szNewCaption = "&" + szNewCaption;
> CtrlSetText(DLG_ASKPATH, NDLG_PBUT_OK, szNewCaption);
> endif;
>
> case SD_PBUT_BROWSE:
> CtrlGetText(DLG_ASKPATH, EDIT_TEXT, svDir);
> StrRemoveSpaces(svDir);
> SelectDir("", "", svDir, TRUE);
> CtrlSetText(DLG_ASKPATH, EDIT_TEXT, svDir);
>
> case SD_PBUT_CONTINUE:
> CtrlGetText(DLG_ASKPATH, EDIT_TEXT, svDir);
> StrRemoveSpaces(svDir);
> ParsePath(szNil, svDir, PATH);
> if (szNil != svDir) then
> PthFixPath(svDir, PthIsAbsPath(svDir));
> endif;
>
> svResultPath = svDir;
> nId = NEXT;
> bDone = TRUE;
>
> case SD_PBUT_BACK:
> nId = BACK;
> bDone = TRUE;
>
> case DLG_ERR:
> nId = ISERR_GEN_FAILURE;
> SdError(nId, DLG_ASKPATH);
> bDone = TRUE;
>
> case DLG_CLOSE:
> SdCloseDlg(hDlg, nId, bDone);
>
> default:
> // check standard handling
> if (SdIsStdButton(nId) && SdDoStdButton(nId)) then
> if (nId != EDIT_TEXT) then
> bDone = TRUE;
> endif;
> endif;
> svResultPath = svDir;
> endswitch;
> endwhile;
>
> EndDialog(DLG_ASKPATH);
> ReleaseDialog(DLG_ASKPATH);
>
> SdUnInit();
>
> // record data produced by this dialog
> if (MODE = RECORDMODE) then
> SdMakeName(szAppKey, DLG_ASKPATH, "", g_nDlgAskPath);
> SilentWriteData(szAppKey, "szPath", DATA_STRING, svResultPath,
> nNil);
> SilentWriteData(szAppKey, "Result", DATA_NUMBER, szNil, nId);
> endif;
>
> return nId;
> end;
>
> "Tony Patterson" <Tony.Patterson@treasury.sungard.com> wrote in message
> news:3c0da21d@news.installshield.com...
> > Thanks a lot Kent, that did indeed help ^^.
> >
> > I have added the AdminAskPath function to my steup.rul and have
customised
> > that to perform what needs to be done. However, when I went to compile
the
> > script, it complained bitterly about not being able to find three header
> > files: StrPriv.h, PthPriv.h, and DialogsPriv.h. I searched my hard drive
> and
> > indeed was unable to locate these. I'm not too sure where to go from
> here...
> > ^^;
> >
> > Cheers
> >
> > Tony
> >
> > "Kent Foyer" <kent@installshield.com> wrote in message
> > news:3c0d5c22$1@news.installshield.com...
> > > AdminAskPath uses the AskPath dialog with different text. So you
could
> > > modify the AskPath dialog, if modifying it doesn't interfere somewhere
> > else
> > > in your setup. If so, you can just create a new dialog and modify the
> > > AdminAskPath code so it calls your new dialog (resource) instead of
the
> > > existing AskPath.
> > >
> > > If you have 7.01, then you have the source code for both AdminAskPath
> and
> > > AskPath--look for AdminAskPath.rul and AskPath.rul. You can just copy
> the
> > > AdminAskPath function call into your setup.rul. Then modify that
> function
> > > call in your setup.rul. That will effectively override the
AdminAskPath
> > > function call in Iswi.obl. Similarly with AskPath in Isrt.obl.
> > >
> > > Hope that helps.
> > >
> > > Kent
> > >
> > > "Tony Patterson" <Tony.Patterson@treasury.sungard.com> wrote in
message
> > > news:3c0d48fc@news.installshield.com...
> > > > Hi,
> > > >
> > > > Is it possible to edit the AdminAskPath dialog, or at least view the
> > code
> > > > that runs it? I need to be able to either customise this dialog or
> > provide
> > > a
> > > > custom dialog of my own with similar functionality.
> > > >
> > > > Cheers,
> > > > Tony
> > > >
> > > >
> > >
> > >
> >
> >
>
>