> Thanks for creating this.  I'm only vaguely familiar with NullSoft, but
> it looks as though this .nsi script requires Cygwin (binaries and
> .dlls) to build either build the installer and/or to actually install
> coLinux.  Am I reading the .nsi file correctly?  If I am, what is
> Cygwin used for and is there any way to eliminate the need for Cygwin?

It uses some of the Cygwin binaries during the install.  It copies the Cygwin binaries into the TEMP directory, runs them from there, and then removes them by the end of the install. They are never installed on the system.  This is no different then Microsoft or other installers that use a VB runtime
or other needed installer executable during the install--it is just the opensource equivalent.  Note that Cooperative Linux still has no dependency on Cygwin and that the system being installed to may or may not have Cygwin before and after the install.

It is using the Cygwin tar.exe to unpack the root filesystem and swap device device files in sparse form.  This is the best way that I currently know of to deliver these in sparse form. Check the documentation I posted earlier for the space savings this gives to the users.

I am also using the Cygwin perl.exe to produce configuration files and command files with the appropriate settings that the user has selected during the install. This could be done in other ways--I am just most comfortable in perl (other people
may prefer python or something else).  I have added to the end of this message the mkcfg.pl perl script that I currently use for this.

Brian Dunford-Shore



# DON'T USE STRICT during an install!
#use strict;

# Installation directory is first argument
my($inst_dir) = shift;
# Output configuration file is second argument
my($output) = shift;
# Filesystem file name is third argument
my($root_fs_file) = shift;

# Copy config file and update paths and root filesystem name
open(CONFIGTMP,"default.colinux.xml") || die "Unable to open configuration template\r\n";
while(<CONFIGTMP>) {
  print CONFIG "$_\r\n";

print CFGCMD "\@echo off\r\n";
print CFGCMD "start \"\%WINDIR\%\\system32\\notepad.exe\" \"$inst_dir\\$output\"\r\n";

# Write a batch file to run the colinux daemon with this configuration.
print SRVCMD "\@echo off\r\n";
print SRVCMD "\"$inst_dir\\colinux-daemon.exe\" --remove- driver\r\n";
print SRVCMD "\"$inst_dir\\colinux-daemon.exe\" -c \"$inst_dir\\$output\"\r\n";

# Write a batch file to install the service.
# This is ran by the setup program if the user chooses that option.
print SRVCMD "\@echo off\r\n";
print SRVCMD "\"$inst_dir\\colinux-daemon.exe\" --remove- driver\r\n";
print SRVCMD "\"$inst_dir\\colinux-daemon.exe\" --install- driver\r\n";
print SRVCMD "\"$inst_dir\\colinux-daemon.exe\" -c \"$inst_dir\\$output\" --install-service\r\n";

# Write a batch file to uninstall the service.
# This may be ran by the user to uninstall the service.
print SRVCMD "\@echo off\r\n";
print SRVCMD "\"$inst_dir\\colinux-daemon.exe\" --remove- service\r\n";
print SRVCMD "\"$inst_dir\\colinux-daemon.exe\" --remove- driver\r\n";