Archive: Install one or more Clients


Install one or more Clients
  Hi!

I'm trying to generate an installation routine which should have the following functionality:
With a installation-routine it should be possible to distribute and install a defined software program to one or more computers automatically.
The selection, which computers should be updated, is realised with a custompage and the result (selection) is stored in a predefined file. The next step is to read this selection-file line by line and to distribute the software accordingly.

As an attachment I send you my version of the installation-routine.
The question is: How do I have to include the components for their proper installation?

Thx

edit:
can't upload files so here a link to ZIP:
multiclients.zip


Can you upload it somewhere else? I keep getting an error message I can't read when trying to download.


sorry here the code from NSI


insertmacro MUI_PAGE_WELCOME

Page custom select_pc

>!insertmacro MUI_PAGE_COMPONENTS
>; Instfiles page
>!insertmacro MUI_PAGE_INSTFILES
>; Finish page
>!insertmacro MUI_PAGE_FINISH


>; Language files
>!insertmacro MUI_LANGUAGE "German"
>!insertmacro MUI_LANGUAGE "English"

>; MUI end ------



>Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
>OutFile "test.exe"
>InstallDir "C:\test"
>ShowInstDetails show
ShowUnInstDetails show
AllowRootDirInstall true



Section -var
Var /GLOBAL TMP
>var /GLOBAL pc
>var /GLOBAL done
StrCpy $TMP "c:\temp"
>strcpy $done "N"
>SectionEnd

>Function .onInit
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "select_pc.ini"
>FunctionEnd

>Function select_pc
!insertmacro MUI_HEADER_TEXT "Clients"
"Select the Client (multiselect possible)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "select_pc.ini"
>FunctionEnd

Section-get_pcnames
Delete "$TMP\pc.txt"
StrCpy $0 "3"
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "select_pc.ini" "Settings" "NumFields"
IntOp $R0 $R0 + 1
FileOpen $R1 "$TMP\pc.txt" "a"

Next_pc:

IntOp $0 $0 + 1
StrCmp$0 "$R0" endloop_pc
!insertmacro MUI_INSTALLOPTIONS_READ $R3 "select_pc.ini" "Field $0" "State"
StrCmp $R3 "0" Next_pc
!insertmacro MUI_INSTALLOPTIONS_READ $R4 "select_pc.ini" "Field $0" "Text"

FileSeek $R1 0 END
FileWrite $R1 "$R4$\r$\n"
goto Next_pc
Endloop_pc:
FileClose $R1
SectionEnd

Section-Readfile
FileOpen$0 "$TMP\pc.txt" r
IfErrors done_read

FileSeek$0 0
loop_read:

FileRead $0 $pc
StrCmp $pc"" done_read
Call Allgemein
goto loop_read

done_read:
FileClose $0

call end_install
>; return
>SectionEnd

>Function Allgemein
MessageBox MB_OK "start install $pc"
call :.sectioninstall
FunctionEnd


Section-Install

.sectioninstall:
StrCmp $done "J" end
MessageBox MB_OK "Install for $pccomlete"
return

end:
>SectionEnd

Section 1 SEC01
MessageBox MB_OK "Section 1"
>SectionEnd

Section 2 SEC02
MessageBox MB_OK "Section 2"
>SectionEnd

Section 3 SEC03
MessageBox MB_OK "Section 3"
>SectionEnd

>Function end_install

Messagebox mb_ok "All installs complete"
strcpy $done "J"

>FunctionEnd
>

and here is a sampe INI


***93;

>NumFields=10

>***91;Field 1***93;
>Type=Label
Text
=SERVER
Flags=NOTABSTOP
Left=0
Right=-1
Top=0
Bottom=10

>***91;Field 2***93;
>Type=Label
Text=E Clients
Flags=NOTABSTOP
Left=0
Right=-1
Top=30
Bottom=40

>***91;Field 3***93;
>Type=Label
Text=i Clients
Flags=NOTABSTOP
Left=0
Right=-1
Top=75
Bottom=85

>;********************
; SERVER *
;********************
***91;Field 4***93;
>Type=Checkbox
Text=SERVER1
State=0
Left=20
Right=100
Top=15
Bottom=25

>***91;Field 5***93;
>Type=Checkbox
Text=SERVER2
State=0
Left=100
Right=180
Top=15
Bottom=25

>;********************
; E Clients *
;********************
***91;Field 6***93;
>Type=Checkbox
Text=E1
State=0
Left=20
Right=100
Top=45
Bottom=55

>***91;Field 7***93;
>Type=Checkbox
Text=E2
State=0
Left=100
Right=180
Top=45
Bottom=55

>***91;Field 8***93;
>Type=Checkbox
Text=E3
State=0
Left=20
Right=100
Top=60
Bottom=70

>***91;Field 9***93;
>Type=Checkbox
Text=E4
Left=100
Right=180
Top=60
Bottom=70
>;********************
; I Clients *
;********************
***91;Field 10***93;
>Type=Checkbox
Text=I1
Left=20
Right=100
Top=90
Bottom=100
>

I don't understand the question. What are those components you wish to install? What do you mean by including them? Do you want to include files with the installer? If so, use File.

If you're asking about installing files to a remote computer, that depends on the protocol you wish to use and the access method. If you wish to use Windows shares, simply write the files to \\server\share, it works just like any other directory.


The problem: you select one ore more Clients in Custom Page.
The Sections (1,2,3), there selectet in Components Page must include in the loop.

Sample:
Select on Customepage "select_pc" 2 Clients
This 2 Clients where Written in a temp File pc.txt
Start MUI_PAGE_COMPONENTS
Select Section 1 and 3
start MUI_PAGE_INSTFILES
Read fist line from pc.txt
Result = Client1
Install selected Sections on Clint1
Read next line from pc.txt
Result = Client2
Install selected Sections on Client2
Read next line from pc.txt
Result = empty
Start MUI_PAGE_FINISH


The Components in the Sample are only you see the Sections are Starts.


So you're asking how to select section from the script? For that you have the macros in Sections.nsh named SelectSection and UnselectSection.