Archive: Problem and doubt


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


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.


How can i do this, i am a newbie


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

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?


can you paste the affected code-snippet?


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?


did you insert a number for #?


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


Ok, it was a good guess. The Field number is infact Field 4.

-Stu


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...


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

This worked fine for me! the older one that you wrote here not!!!
Thanks


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


Use !define MUI_FINISHPAGE_RUN_NOTCHECKED

-Stu


I love this guy, I love you... you are ta man!!!
Thanks for share your invaluable knowledge