kukomamasan
5th November 2008 16:34 UTC
Make 2 different welcome messages?
Hi again,
I want to make my installer more smooth, problem is i have an error message (message box), if the path could not be found in the registry in .oninit, telling browse to the right folder since installer could not locate the right path. I would like that message part of the welcome message(only if its not found in reg), else welcome message should say something like, path to the (program) was found, just press install to continue ect... How is that done ? i attached what i have so far.
Edit:
Damn sometime using the brain will help lol, i figured it out, it look like this :-)
!define MUI_PAGE_CUSTOMFUNCTION_SHOW ChangeDirTextFunction
Function ChangeDirTextFunction
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\GhostRecon.exe" "path"
StrCmp $R0 "" NotPresent2 Present2
notpresent2:
FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $R1 $R0 1006
SendMessage $R1 ${WM_SETTEXT} 0 `STR:Welcome To BB_AIO_180 installer, Installer could not find ghostrecon installation folder,So Browse to GhostRecon installation Folder.`
StrCpy $INSTDIR "$programfiles\Red Storm Entertainment\Ghost Recon\"
goto done2
present2:
FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $R1 $R0 1006
SendMessage $R1 ${WM_SETTEXT} 0 `STR:Welcome To BB_AIO_180 Installer$\nThis Installer Found Your Ghost Recon Folder,$\nPath Should Be In The Path Window, Just Press install.` ;sets the labels text
done2:
FunctionEnd
Can i highligh the txt when path is not found, like red txt ? that will be cool.
Yathosho
5th November 2008 16:58 UTC
you can have multiple welcome pages and skip one of them if a condition is met. i don't know if there's the possibility to change the text displayed on a condition, but you can do so using a welcome page created with nsDialog
kukomamasan
5th November 2008 17:04 UTC
thx yathosho,
now i just need to change colours on the txt font, green for good, red for bad :-).
Also im not much into this scripting, i find it easier to find exampels stuff, and experiment on it, or just ask in here ofcourse, after i did some search ofcourse(above was a brain fart from my side hehe), but colours is not?
Exampel, where should a noob like me, know that you have to do this to make a simpel welcome message ?
!define MUI_PAGE_CUSTOMFUNCTION_SHOW ChangeDirTextFunction
Function ChangeDirTextFunction
FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $R1 $R0 1006
SendMessage $R1 ${WM_SETTEXT} 0 `STR:Welcome To BB_AIO_180 installer, Installer could not find ghostrecon installation folder,So Browse to GhostRecon installation Folder.`
FunctionEnd
BIG THX to ZmAn3 For showing above option.
I read the documentation i think :-), and tried all the test scripts, but dont remember seeing an exampel to make your own welcome message, and i dont even know what that stuff mean???, maybe it should be made easier to make your own welcome message, since, who would ever have though it was like that ??? hehe
kukomamasan
5th November 2008 17:26 UTC
Yathosho Said:
i'm don't know if there's the possibility to change the text displayed on a condition, but you can do so using a welcome page created with nsDialog
Plz teach me :-)
kukomamasan
5th November 2008 18:29 UTC
Oh, yea thats right, its maybe not the welcome message im refering to :-).
in my installer i skip right to the install path window(no licence window, no agree to read ect. window, just pure press install if ur good to go hehe), so there where i am, in the install window, and thats where the messages should go(works so far, since thats the first window thats pops up).
Now in the install window i want to say path displaying is good, or not good(if its not good, ppl are not alowed to install there anyway), and i want that different messages displayed in txt in the install window(its working so far), as a bonus i want it to be red txt (path is no good) if its not good hehe (green if its good), should be clr for all i hope.
Edit:
And if you dont fully understand this, i understand, since its not in NSIS script language, its in some kind of english language, thats the language i understand more than NSIS hehe