Archive: Custom Page Help


Custom Page Help
Hi all,

I have one custom page to display the list of installed driver with version number.

How can I define macro for this custom page, so that whenever I execute the setup.exe then depending on the availability of driver in the system I can display the proper message.

As custom page has "MUI_HEADER_TEXT" macro, with this macro I am able to change the header text in runtime.

How can I define same type of macro for displaying the message on the body of the custom page.

Please suggest me.

Venu


1. Read the InstallOptions documentation about how to create a custome page and add a Text or Static control on it.

2. Read about IfFileExists and GetDllVersion to detect the driver and get its proper version.


Thanks for ur reply.

I am able to create custom page and able to display it also and even able to get the installed driver version using GetDLLVersion. but my problem goes like this..

As I have to first check for installed driver, if the prior installation of driver found, then on the Custom Page Header I want to disply the message as "Prior Installation of driver 'A' found" otherwise "Prior Installation of driver 'B' found", and if there is no driver installed doesnot display the page. All these things I am able to do because there is a MACRO "MUI_HEADER_TEXT" for custom page so

code
-----
Function CustomPage
InstallOptions::initDialog /NOUNLOAD "$PLUGINSDIR\test.ini"
Pop $hwnd
IfFileExists "$WINDIR\System32\Driver\driver1.sys" 0 next
!insertmacro MUI_HEADER_TEXT "Already Installed" "Prior Installation of Driver 1 Found"
Goto Done
next:
IfFileExists "$WINDIR\System32\Driver\driver2.sys" 0 next
!insertmacro MUI_HEADER_TEXT "Already Installed" "Prior Installation of Driver 2 Found"
Done:
InstallOptions::show
Pop $0
FunctionEnd
---------

Now on the same page, if prior installation exists, I want to display the version of the driver on the body of the custom page. as there is no macro available for this I am writing into the .ini file as:

----------------
Function .onInit
Call GetDrvVersion ;this initializes the "$VersionNumber"
WriteINIStr "$EXEDIR\CustomPage.ini" 'Field 2' State '$VersionNumber'

InitPluginsDir
File /oname=$PLUGINSDIR\test.ini "CustomPage.ini"
FunctionEnd
-----------------

But the version number of the driver on the custom page only gets changed when I compile the script two times. because in first compilation it updates the CustomPage.ini and in second Compilation and execution its updates the page.

So my question is can we have some macro like "MUI_HEADER_TEXT" to display text on the body of custome page, which actually doesnot need any compilation.

Thanks & Regards
Venu


I want to represent my problem in another way.

As I have custom page, and there is "Label" I have defined on the custom page. My installer supports 6 different languages, I am able to change the Header of the custom Page according to languages choosen by user with "MUI_HEADER_TEXT" macro.

But how to change the text of "Label" field. I tried by modifying the .ini[custom page] file but it doesn't work out.

Can I define some macros for custom pages to display text on the body of the page, not as a header.

Please help me, its badly needed for the project.

Thanks and Regards
Venu


Logically, this code will not work:


Function .onInit
Call GetDrvVersion ;this initializes the "$VersionNumber"
WriteINIStr "$EXEDIR\CustomPage.ini" 'Field 2' State '$VersionNumber'

InitPluginsDir
File /oname=$PLUGINSDIR\test.ini "CustomPage.ini"
FunctionEnd

You are writing to "$EXEDIR\CustomPage.ini" before it exists and then overwriting it with another file being extracted!

Should be:

Function .onInit
InitPluginsDir
File /oname=$PLUGINSDIR\test.ini "CustomPage.ini"
Call GetDrvVersion ;this initializes the "$VersionNumber"
WriteINIStr "$PLUGINSDIR\test.ini" "Field 2" "State" "$VersionNumber"
FunctionEnd


-Stu