carlosfocker
3rd December 2007 16:09 UTC
Messagebox with a Textbox
Anyone know if its possible to have a messagebox with a textbox. I have this situation where I perform some actions during the .oninit function that use a path that is grabbed from the registry. The problem is I have found some inconsistency's with the registry key that holds the value. I need the user to be able to verify the value if a certain file is not found and input a new value in it is not correct.
Anders
3rd December 2007 16:37 UTC
a directory page can be used to do this, or a custom page with InstallOptions or nsDialogs
carlosfocker
3rd December 2007 17:06 UTC
Its doesn't seem like I can initiate any of these suggestions via the .oninit function. This needs to be done on installer startup
Anders
3rd December 2007 17:16 UTC
that is correct, but you could do it on the first page
carlosfocker
3rd December 2007 17:46 UTC
That's the problem. I need the user to verify a path(not install path) before the first page is displayed(in the onint function. Here's what I'm trying to do(all with in the oninit function).
1. Search the registry for the sql data root.
ReadRegStr $SqlDataRoot HKLM "SOFTWARE\Microsoft\MSSQLServer\Setup" "SQLDataRoot"
2. If the master.mdf file does not exist in this folder I can assume that the folder is incorrect.
IfFileExists $SqlDataRoot\master.mdf SqlDataCheckPassed 0
3. If i can't find the file then I ask the user to specify a valid path.
4. Find all disconnected databases that apply to the application I am working with. These are located in the MSSQL data root.
5. Populate a drop down list on a page to allow the user to select the a database to reconnect to sql.
Afrow UK
3rd December 2007 18:02 UTC
Add a page before the first page with the Page Custom instruction. You can skip the page by calling Abort in the page's show function.
Stu
carlosfocker
3rd December 2007 18:47 UTC
Maybe I'm missing something but how does that solve the fact that this path needs to be verified in the .oninit function. Doesn't the oninit function get called before pages even get rendered? As far as know you can't use Page custom inside a function.
Afrow UK
3rd December 2007 18:50 UTC
You don't need to do it in the .onInit function. You could do it in the page show function.
Stu
carlosfocker
3rd December 2007 18:58 UTC
The whole idea is that I want the user to verify data that is found and used in the .oninit function if its found to be incorrect. This data is used by code within the the oninit function.
Afrow UK
3rd December 2007 19:38 UTC
There is little difference between putting your code in the .onInit function and putting it in your first custom page's show function. Try it and you will see. If you really have to have it in .onInit then you just need to set a boolean flag in a variable before leaving .onInit.
Stu
Yathosho
3rd December 2007 22:58 UTC
actually i'd love to see something like messagebox 2.0, offering more options to the user. you add the functionality of the messagebox plugin and add features like messageboxes with countdown or a checkbox to remember a choice. maybe nsdialogs can get a part to manage advanced messageboxes?