|
|
#1 |
|
Junior Member
Join Date: Sep 2006
Posts: 5
|
Network check
Hello @all,
i have two install options. Local and Network. I want to check at the begin of setup.exe, if the network resource is reachable. If the network isn't reachable (e.g. setup.exe is on a CD) the option should not be available. Function .onInit !insertmacro MUI_LANGDLL_DISPLAY StrCpy $1 ${LocInstHint} IfFileExists "$EXEDIR\fileexists.txt" NetworkExists NetworkUnreachable NetworkUnreachable: MessageBox MB_OK "file isn't installed" ' code to disable the network install option ??? NetworkExists: MessageBox MB_OK "file is installed" FunctionEnd Function .onSelChange !insertmacro StartRadioButtons $1 !insertmacro RadioButton ${LocInstHint2} !insertmacro RadioButton ${LocInstHint} !insertmacro EndRadioButtons FunctionEnd Is .onInit the right place for this check? How can I check/uncheck the RadioButton with code? Thx ginther |
|
|
|
|
|
#2 |
|
Major Dude
|
i'd do the check in the init function of the components page.
there you need to use SectionGetFlags and SectionSetFlags to set/unset the selected flag on the sections. hand by comm@nder21 ---------- WiKi pages:CreateInternetShortcut|Enhanced FindWindow|Parse CSV-Data|Open/Close CD-Drive|Installer without Icon|Vista application compatibility |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Sep 2006
Posts: 5
|
Thx Comm@nder21 for the fast reply.
ginther |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Sep 2006
Posts: 5
|
The NSIS helpfile show an example for an hidden Section:
Section "-hidden section" SectionEnd Isn't it possible to use a variable for "-hidden section"? In my project the variable $InstallNetwork isn't able to hide the Section (see Code). There are always the specified section called -Installation (network) available. Is there a possibility to solve this problem? Thx Section /o $InstallNetwork LocInstHint2 ... SectionEnd Function .onInit !insertmacro MUI_LANGDLL_DISPLAY StrCpy $1 ${LocInstHint} ; Group 1 - Option 1 is selected by default IfFileExists "$EXEDIR\fileexists.txt" NetworkExists NetworkUnreachable NetworkUnreachable: MessageBox MB_OK "file isn't installed" StrCpy $InstallNetwork "-Installation (network)" GoTo Label NetworkExists: MessageBox MB_OK "file is installed" StrCpy $InstallNetwork "Installation (network)" Label: FunctionEnd |
|
|
|
|
|
#5 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
To hide a section, set its name to nothing at runtime using SectionSetText. The hyphen is only checked on compile time.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Sep 2006
Posts: 5
|
Hello kichik,
i solved the problem by using a similar method. ... NetworkUnreachable: MessageBox MB_OK "file isn't installed" StrCpy $InstallNetwork "" ... But i think using SectionSetText section_index "" is the prefered method. ![]() Thx for your hint. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|