5of0
1st February 2006 06:18 UTC
Network distribution?
Is it possible to get NSIS to do a network installation - I've got an install working now, but I want it to install as it is, but on several computers in a network. I've found a script that finds comptuers on a network, but that's only halfway. Is there a way that I could dynamically create sections, or have a page that would allow the user to select the computers to distribute to? Or is there a better (i.e. different app) that would do this easily? I could try psuedo-hard-coding it (check if the computer name has the right prefix, then install the files if it does), but I would like it to be more flexible. All the computers have the desired installation directory shared.
Mr Inches
1st February 2006 12:54 UTC
Yes, some network installs can be done, but how complex it is and whether it can actually be done, depends on what components you need to install.
Here are some ideas:
For selecting a computer to install, try building a list of the computer names separated by '|' characters and write this list as the value for a LISTBOX control on a custom InstallOptions page. Read the State value for that Field using a Leave function for the custom page and it will have the computer name in it.
Installing files can be done using UNC paths for the destination directories. For example:
StrCpy $INSTDIR "\\$TargetComputer\C$\$ProgramFiles\App"
SetOutPath $INSTDIR
File "App.exe"
(Since you say you already have a share to the install path, just substitute it for the "C$\$ProgramFiles\App" bit and you get the same result).
If you need to do registry changes, you can use one of the (ns)Exec commands to do REG commands on the remote computers, but they need to be running the Remote Registry Service for this to work properly (Windows 2000 and above have this on by default and previous versions don't have or need it - I think). For example:
Exec "REG ADD \\$TargetComputer\HKLM\Software\App /v InstallPath /t REG_SZ /d $INSTDIR"
Un-Installs across the network might be trickier but I imagine the same techniques could be applied e.g. select a computer to uninstall the application from, checking that it is installed before adding it in the list.
5of0
2nd February 2006 00:41 UTC
Thanks, will do...
OK, looking around, that seems to suit my needs just fine. I don't need a network uninstaller, I'll be just fine with an installer. I'm working with Win2000 machines, so it sounds like the registry stuff should work. Thanks for the help, I'll let you know how it turns out.