- NSIS Discussion
- Problem and doubt
Archive: Problem and doubt
Pet Gr
1st March 2005 14:51 UTC
Problem and doubt
Before I show the installer i use a function in which i check if the program is installed, the user can install all the things but there is no need to have the program installed, but i used an option to run the program on the las page of the installer, how can i disable the run program if it is not installed in the system
Thanks again
Greetings
Yathosho
1st March 2005 14:53 UTC
you can write it into a variable whether the program is installed and skip the page. you will find multiple posts on this, searching the forum.
Pet_Gr
1st March 2005 15:27 UTC
How can i do this, i am a newbie
Afrow UK
1st March 2005 17:43 UTC
You need to remove the check-box on your finish page then?
You could delete it using:
!define MUI_PAGE_CUSTOMFUNCTION_PRE checkForProg
!insertmacro MUI_PAGE_WELCOME
Function checkForProg
# check if it exists here?
DeleteINISec "$PLUGINSDIR\ioSpecial.ini" "Field #"
FunctionEnd
However, I don't know which Field number it is. It's probably something like Field 4... You'll have to experiment to get it right.
Obviously, if your program exists, then you don't want to jump over the DeleteINISec command. You can jump over it using StrCmp.
E.g. StrCmp $R0 "1" 0 +2
-Stu
pet_gr
1st March 2005 22:53 UTC
It seems not to work it allows me to hide the elements in the last page but i'm not allowed of hide the check box... what can i do?
Yathosho
1st March 2005 23:52 UTC
can you paste the affected code-snippet?
Pet_gr
2nd March 2005 07:43 UTC
The code is the code wrote by AFROW UK, i need to disable the run check box in the last page of the uninstaller, but i can get it disabled, what can i do?
Yathosho
2nd March 2005 10:13 UTC
did you insert a number for #?
Afrow UK
2nd March 2005 14:23 UTC
You need to change Field # to e.g. Field 4, like I said. I don't know which Field number it is for your check-box therefore you need to experiment.
If you want to simply disable the run check-box, then change:
DeleteINISec "$PLUGINSDIR\ioSpecial.ini" "Field #"
...to...
WriteINIStr "$PLUGINSDIR\ioSpecial.ini" "Field #" "Flags" "DISABLED"
Again, change the field number to the right one!
-Stu
Afrow UK
2nd March 2005 14:25 UTC
Ok, it was a good guess. The Field number is infact Field 4.
-Stu
Pet_gr
2nd March 2005 14:33 UTC
I've tried with all the numbers and yes it disable the lateral graphic, the main text,the explain item but the chek box is not disabled by i don't know why...
Afrow UK
2nd March 2005 14:43 UTC
Works for me:
!include MUI.nsh
OutFile testing.exe
!define MUI_FINISHPAGE_RUN "$INSTDIR\testing.exe"
!define MUI_FINISHPAGE_TEXT "Run me!"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
!define MUI_PAGE_CUSTOMFUNCTION_PRE "disable"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE English
Function disable
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Flags" "Disabled"
FunctionEnd
Section
SectionEnd
Are you using the latest version of NSIS?
-Stu
Pet_Gr
2nd March 2005 15:08 UTC
This worked fine for me! the older one that you wrote here not!!!
Thanks
Pet_Gr
2nd March 2005 17:35 UTC
Sorry but i need some improvements on this, now i've had it disabled but it's checked so the installer tries to launch the software, now how can i uncheck it?
Greetings
Pedro Garcia Rodriguez
Afrow UK
2nd March 2005 19:02 UTC
Use !define MUI_FINISHPAGE_RUN_NOTCHECKED
-Stu
Pet_Gr
3rd March 2005 11:29 UTC
I love this guy, I love you... you are ta man!!!
Thanks for share your invaluable knowledge