Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Custom Scripts


1 reply to this topic

IS11noob

IS11noob
  • Members
  • 3 posts

Posted 02 September 2005 - 21:23

Ok, here is the run down of what I am exactly trying to accomplish….

I have created a custom dialog screen that has a new control on it that is called “TEST”. When they click this “TEST” button it will test if the person has .NET Framework installed. If they do it will pop up a message telling them that it has been detected and they are ok to continue on with the installation. If the don’t have .NET Framework it will pop up a message telling them that they don’t have it and ask them if they want to install it now. When they click ok it will copy dotnetfix.exe to their local cache directory and start the exe file. Now going through the all the help files, knowledge base, and hell the Learning InstallScript Projects book I have gotten the code mostly completed. The problem is that when I try to build my installation it does not like my custom script that I created. Basically saying it cannot include it. Now below is my code for the custom script.

Custom Script name is: CustomDialog.rul
Custom Dialog name is: DotNetDetection


#include "ifx.h"
#define Test_Button 1302

prototype NUMBER CustomDialog();

function NUMBER CustomDialog();

begin
EzDefineDialog("DotNetDetection", ISUSER, "DotNetDetection", NULL);

RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);

while (!bDone)
nCtrl = WaitOnDialog("DotNetDetection");
switch (nCtrl)

case Test_Button:
SdShowMsg("Searching for .NET Framework", TRUE);
if (RegDBKeyExist("SOFTWARE\\Microsoft\\.NETFramework\\policy\\v1.0") = 3705) then
SdShowMsg("", False);
MessageBox("Micrsoft .NET Framework has been detected on your system.\nClick OK to Continue", INFORMATION);
else
if (RegDBKeyExist("SOFTWARE\\Microsoft\\.NETFramework\\policy\\v1.0") = 4322) then
SdShowMsg("", False);
MessageBox("Micrsoft .NET Framework has been detected on your system.\nClick OK to Continue", INFORMATION);
else
SdShowMsg("", False);
MessageBox("This application requires Microsoft .NET Framwork.\nWould you like to install this now?", INFORMATION);
//if
//XCopyFile(SRCDIR ^ "Readme.txt", TARGETDIR, COMP_NORMAL);
end if
end if

case SD_PBUT_OK:
nReturn = SD_PBUT_OK;
bDone = TRUE;

case SD_PBUT_BACK:
nReturn = SD_PBUT_BACK;
bDone = TRUE;

case SD_PBUT_CANCEL:
Do(EXIT);

endswitch;
endwhile;

EndDialog("DotNetDetection");
ReleaseDialog("DotNetDetection");

end;


This is what I have included in the setup.rul file….
At the top under this line;
#include “ifx.h”

I put my include for the custom script:
#include “CustomDialog.rul”

And further down I put this code in for my dialog box to come up:
Dlg_CustomDialog:
nResult = CustomDialog();
if (nResult = SD_PBUT_BACK) goto Dlg_SdWelcome;


I get this error when compiling my scripts:
InstallShield Script Compiler
Version 11.0.0.28844
Copyright 1997-2005 Macrovision Europe Ltd. and/or Macrovision Corporation. All Rights Reserved.

Compiling...
setup.rul
C:\My InstallShield 11 Projects\Tronitech\TTechPublisher\setup.rul(19) : fatal error F8511: can't open include file
Setup.inx - 1 error(s), 0 warning(s)
ISDEV : error -4370: There were errors compiling InstallScript

Now please I need some help with this. I keep reading and reading, but I can’t find why this isn’t working. Now I’m very new to this program. I have tried bypassing all of this and adding just the redistributable to the release, but .NET Framework does not inherently test to see if it’s already there, and I only want the install message to come up if they don’t have it. So please any help would be useful. Even if you know a completely different way of doing the same thing, please let me know.

Thank you for your help,
Andrew Helton

Edited by IS11noob, 02 September 2005 - 21:45.


IS11noob

IS11noob
  • Members
  • 3 posts

Posted 07 September 2005 - 17:19

nm I figured out my issue.