> 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

==============mkcfg.pl===============================


#!/usr/bin/perl

# 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";
open(CONFIG,">$output");
while(<CONFIGTMP>) {
  s/c:\\colinux/$inst_dir/gi;
  s/root_fs/$root_fs_file/g;
  chomp;
  print CONFIG "$_\r\n";
}
close(CONFIG);
close(CONFIGTMP);

open(CFGCMD,">cfg_colinux.cmd");
print CFGCMD "\@echo off\r\n";
print CFGCMD "start \"\%WINDIR\%\\system32\\notepad.exe\" \"$inst_dir\\$output\"\r\n";
close(CFGCMD);

# Write a batch file to run the colinux daemon with this configuration.
open(SRVCMD,">colinux.cmd");
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";
close(SRVCMD);

# Write a batch file to install the service.
# This is ran by the setup program if the user chooses that option.
open(SRVCMD,">install_service.cmd");
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";
close(SRVCMD);

# Write a batch file to uninstall the service.
# This may be ran by the user to uninstall the service.
open(SRVCMD,">uninstall_service.cmd");
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";
close(SRVCMD);

exit;