set AlternateFstab "No /etc/fstab on your system, please, give an alternate filename"
set IsCDwrite "is a cdrom.\n\n Please, let me know if you want to write CDs on this device."
set RootDrives1 "I need to know which directories from the root (that is "
set RootDrives2 "on your system) you want to use under wine. Any folder wher you wish to put Applications or store files must show up there. Choose in the left list below. Selected folders will appear on the right list."
set WhereTmp "Could not find /tmp, enter the folder to use for temporary files"
if {[lindex$line 1] != "/"}{ TkW:addUnixDriveOK $line}{set lineroot $line}
}
proc TkW:addUnixDriveOK {line}{
# for now, I'll consider any unix file as ext2...
# may be this should improve a bit!
global NunixDrives UnixPath UnixDevice UnixLabel UnixType UnixSerial UnixFS
global TMPDRIVE HOMEDRIVE exclude
set NunixDrives [expr $NunixDrives +1]
set UnixDevice($NunixDrives)[lindex$line 0]
set UnixType($NunixDrives)"hd"
set UnixPath($NunixDrives)[lindex$line 1]
set exclude "$exclude$UnixPath($NunixDrives) "
set UnixLabel($NunixDrives)"UNIX $NunixDrives"
if {[string first "/tmp" $UnixPath($NunixDrives)] > 0 && $TMPDRIVE == 0}{
set UnixLabel($NunixDrives)"TEMP"
}
if {[string first "/home" $UnixDevice($NunixDrives)] > 0 && $HOMEDRIVE == 0}{
set UnixLabel($NunixDrives)"HOME"
}
set UnixDevice($NunixDrives)""
set UnixSerial($NunixDrives)""
set UnixFS($NunixDrives)"win95"
set UnixType($NunixDrives)"hd"
}
proc TkW:addDosDrive {line}{
# for now, I'll consider any dos file as ext2...
# may be this should improve a bit!
global NdosDrives DosPath DosDevice DosLabel DosType DosSerial DosFS
global TMPDRIVE HOMEDRIVE exclude
if {![file exists [lindex$line 1]]}{return}
if {[string first "/dev/fd"[lindex$line 0]] == 0 }{
TkW:addFloppy $line
return
}
set NdosDrives [expr $NdosDrives +1]
set DosDevice($NdosDrives)[lindex$line 0]
set DosPath($NdosDrives)[lindex$line 1]
set exclude "$exclude$DosPath($NdosDrives) "
set DosLabel($NdosDrives)""
set DosType($NdosDrives)"win95"
if {[lindex$line 2] == "msods"}{
set DosFS($NdosDrives)
}else{
set DosFS($NdosDrives)"win95"
}
set DosSerial($NdosDrives)""
}
proc TkW:unknownDeviceType {line}{
TkW:message "Error\n\
[lindex$line 0] (mounted on [lindex$line 1]) : Unknown device type. Please, mail thirot@univ-brest.fr for me to add this filesystem to the list of detected FS.\n\
\n Thank you.\
\n Jean-Louis Thirot"
global WAIT
set WAIT wait
while {$WAIT == "wait"}{update}
}
proc TkW:InitNewConfig {}{
global NunixDrives UnixPath UnixDevice UnixLabel UnixType UnixSerial UnixFS
global NdosDrives DosPath DosDevice DosLabel DosType DosSerial DosFS
global Ncdroms CDPath CDDevice CDLabel CDType CDSerial CDFS
global Nfloppys FLOPPYPath FLOPPYDevice FLOPPYLabel FLOPPYType FLOPPYSerial FLOPPYFS
global NnetDrives
global TMPDRIVE HOMEDRIVE
global exclude; set exclude ""
set TMPDRIVE 0
set HOMEDRIVE 0
set NunixDrives 0
set NdosDrives 0
set Ncdroms 0
set Nfloppys 0
set NnetDrives 0
}
proc TkW:ShowDrives {}{
global NunixDrives UnixPath UnixDevice UnixLabel UnixType UnixSerial UnixFS
global NdosDrives DosPath DosDevice DosLabel DosType DosSerial DosFS
global Ncdroms CDPath CDDevice CDLabel CDType CDSerial CDFS
global NnetDrives NetPath NetLabel
global Nfloppys FLOPPYPath
global DriveRank DRIVEUNIXPATH DRIVEDOSPATH NDRIVES
global OUTF
set NDRIVES 0
set letters {let: C D E F G H I J K L M N O P Q R S T U V W X Y Z}
set lettersF {let: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z}
for {set i 1}{$i <= $NdosDrives}{set i [expr$i + 1]}{
set NDRIVES [expr $NDRIVES + 1]
set rank $DriveRank($i)
puts $OUTF "\[Drive [lindex$letters$i]\]"
set Letter($NDRIVES)[lindex$letters$i]
set DRIVEUNIXPATH($NDRIVES) $DosPath($rank)
set DRIVEDOSPATH($NDRIVES)"[lindex$letters$i]:\\"
puts $OUTF "Path=$DosPath($rank)"
puts $OUTF "Type=hd"
puts $OUTF "Label=MS-DOS $rank"
puts $OUTF "Filesystem=$DosFS($rank)"
puts $OUTF ""
}
for {set i 1}{$i <= $Nfloppys}{set i [expr$i + 1]}{
if {$i > 2}{
set NDRIVES [expr $NDRIVES + 1]
set NLet $NDRIVES
set DRIVEDOSPATH($NDRIVES)"[lindex$lettersF $NLet]:\\"
set DRIVEUNIXPATH($NDRIVES) $FLOPPYPath($i)
}else{
set NLet $i
#set DRIVEDOSPATH($i)"[lindex$lettersF $NLet]:\\"
#set DRIVEUNIXPATH($i) $FLOPPYPath($i)
}
puts $OUTF "\[Drive [lindex$lettersF $NLet]\]"
puts $OUTF "Path=$FLOPPYPath($i)"
puts $OUTF "Type=floppy"
puts $OUTF "Label=Floppy $i"
puts $OUTF "Serial=87654321"
puts $OUTF ""
}
for {set i 1}{$i <= $Ncdroms}{set i [expr$i + 1]}{
set NDRIVES [expr $NDRIVES + 1]
puts $OUTF "\[Drive [lindex$letters $NDRIVES]\]"
puts $OUTF "Path=$CDPath($i)"
set DRIVEDOSPATH($NDRIVES)"[lindex$letters $NDRIVES]:\\"
set DRIVEUNIXPATH($NDRIVES) $CDPath($i)
puts $OUTF "Type=cdrom"
puts $OUTF "Label=CDROM $i"
puts $OUTF "Filesystem=$UnixFS($i)"
if {$CDDevice($i) != ""}{puts $OUTF "Device=$CDDevice($i)"}
puts $OUTF ""
}
for {set i 1}{$i <= $NunixDrives}{set i [expr$i + 1]}{
set NDRIVES [expr $NDRIVES + 1]
puts $OUTF "\[Drive [lindex$letters $NDRIVES]\]"
set DRIVEDOSPATH($NDRIVES)"[lindex$letters $NDRIVES]:\\"
set DRIVEUNIXPATH($NDRIVES) $UnixPath($i)
puts $OUTF "Path=$UnixPath($i)"
puts $OUTF "Type=hd"
puts $OUTF "Label=$UnixLabel($i)"
puts $OUTF "Filesystem=$UnixFS($i)"
puts $OUTF ""
}
for {set i 1}{$i <= $NnetDrives}{set i [expr$i + 1]}{
set NDRIVES [expr $NDRIVES + 1]
puts $OUTF "\[Drive [lindex$letters $NDRIVES]\]"
set DRIVEDOSPATH($NDRIVES)"[lindex$letters $NDRIVES]:\\"
set DRIVEUNIXPATH($NDRIVES) $NetPath($i)
puts $OUTF "Path=$NetPath($i)"
puts $OUTF "Type=network"
puts $OUTF "Label=$NetLabel($i)"
puts $OUTF "Filesystem=win95"
puts $OUTF ""
}
}
proc TkW:MiscEndConf {temp}{
#Create an acceptable PATH variable, and
# gets the TMP WINDOWS and SYSTEM drive letters:
global PATH NDRIVES Letter DRIVEPATH
global TMPLetter
set PATH ""
for {set i 1}{$i<= $NDRIVES}{set i [expr$i + 1]}{
if {[info exists Letter($i)]}{
if {[info exists DRIVEPATH($i)]}{
if {$DRIVEPATH($i) == $temp}{
set TMPLetter $Letter($i)
}
set PATH "$PATH\;$Letter($i):\\"
}
}
}
return
}
proc TkW:Unix2Dos {unixpath}{
global NDRIVES DRIVEDOSPATH DRIVEUNIXPATH
set dospath ""
# First, search the corresponding drive:
for {set i 1}{$i<=$NDRIVES}{set i [expr$i + 1]}{
set n [string first $DRIVEUNIXPATH($i)$unixpath]
if {$n == 0}{
set dospath $DRIVEDOSPATH($i)
set N [expr[string length $DRIVEUNIXPATH($i)] + 1]
break
}
}
# Now, add the remaining part of the path
for {set i $N}{$i <= [string length $unixpath]}{set i [expr$i + 1]}{
set newchar [string range $unixpath$i$i]
if {$newchar != "/"}{
set dospath "$dospath$newchar"
}else{
set dospath "$dospath\\"
}
}
return $dospath
}
proc TkW:addCdRomDrive {line}{
global Ncdroms CDPath CDDevice CDLabel CDType CDSerial CDFS
global IsCDwrite YES NO WAIT
if {![file exists [lindex$line 1]]}{return}
set Ncdroms [expr $Ncdroms + 1]
set CDFS($Ncdroms)"iso9660"
set CDPath($Ncdroms)[lindex$line 1]
set dev [lindex$line 0]
TkW:message2 "Device $dev$IsCDwrite" $YES $NO
set WAIT wait
while {$WAIT == "wait"}{update}
if {$WAIT == "opt1"}{set CDDevice($Ncdroms)$dev}{set CDDevice($Ncdroms)""}
set CDLabel($Ncdroms)"CDrom"
}
proc TkW:addNetDrive {line}{
global NnetDrives NetPath NetLabel
set NnetDrives [expr $NnetDrives + 1]
set NetPath($NnetDrives)[lindex$line 1]
set NetLabel($NnetDrives)[file tail $NetPath($NnetDrives)]
}
proc TkW:addFloppy {line}{
global Nfloppys FLOPPYPath FLOPPYDevice FLOPPYLabel FLOPPYType FLOPPYSerial FLOPPYFS
if {![file exists [lindex$line 1]]}{return}
set Nfloppys [expr $Nfloppys + 1]
set FLOPPYPath($Nfloppys)[lindex$line 1]
set FLOPPYDevice($Nfloppys)[lindex$line 0]
}
proc TkW:SortDosDrives {}{
global NdosDrives DosDevice DriveRank
set devlist ""
for {set i 1}{$i <= $NdosDrives}{set i [expr$i + 1]}{
set devlist "$devlist$DosDevice($i):TKW:$i"
}
set devlist [lsort$devlist]
set i 1
foreach dev $devlist{
set n1 [expr[string first ":TKW:"$dev] + 5]
set n2 [string length $dev]
set DriveRank([string range $dev$n1$n2])$i
set i [expr$i + 1]
}
}
proc TkW:SearchTmp {}{
global exclude
global NunixDrives UnixPath UnixLabel UnixType UnixFS
global NdosDrives DosPath DosLabel DosType DosFS
global WAITfilename GetFileName NDRIVES DRIVEUNIXPATH DRIVEDOSPATH
global WhereTmp OK CANCEL
# Check if it /tmp is alreaddy mounted (when it has it's own partition)
foreach i $exclude{
if {$i == "/tmp"}{return /tmp}
}
# check that we have a /tmp:
if {[file exists /tmp]}{
set NunixDrives [expr $NunixDrives + 1]
set UnixPath($NunixDrives) /tmp
set exclude "$exclude$UnixPath($NunixDrives) "
set UnixLabel($NunixDrives)"TEMP"
set UnixType($NunixDrives) hd
set UnixFS($NunixDrives) win95
return /tmp
}else{
#Could add here a search for c:\TEMP or c:|windows\temp
set WAITfilename wait
TkW:GetFileName $WhereTmp $OK $CANCEL Folder
# check if this folder is on a drive that has an entry in
# wineconf (Must be a unix or dos drive)
for {set i 1}{$i<=$NdosDrives}{set i [expr$i +1]}{
if {[string first $DosPath($i) $GetFileName] == 0}{
return $GetFileName
}
}
for {set i 1}{$i<=$NunixDrives}{set i [expr$i +1]}{
if {[string first $UnixPath($i) $GetFileName] == 0}{
return $GetFileName
}
}
# I'll consider this new one as unix, althought if it's win fs that's ok
set NunixDrives [expr $NunixDrives + 1]
set UnixPath($NunixDrives) $GetFileName
set exclude "$exclude$UnixPath($NunixDrives) "
set UnixLabel($NunixDrives)"TEMP"
set UnixType($NunixDrives) hd
set UnixFS($NunixDrives) win95
return $GetFileName
}
}
proc TkW:FindWindows {}{
global NdosDrives DosPath WINLetter SYSLetter Letter
#first attempt: C:\windows (would avoid to search)
if {[file exist $DosPath(1)/windows]}{
return "$DosPath(1)/windows"
}
for {set i 1}{$i<=$NdosDrives}{set i [expr$i + 1]}{
set searchWin [open"| find $DosPath($i) -name win.ini -print" r+]
set CONFIRMQUIT "This will close TkWineSetup.\n \"Quit Saving\" will store your choices (source and install folders, compilation options etc..) for the next start. \"Quit No Save\" aborts any changes you made."
set QUITSAVING "Quit Saving"
set QUITNOSAVE "Quit No Save"
#related to browsers:
set GETDIRtitle "TkWineSetup - Get directory"
set FOLDBROWSEtitle "TkWineSetup - Directories browser"
set BROWSE BROWSE
set CHFOLD "Choose folder"
set CHFOLDsel "Selected directory:"
#related to downloads:
set DOWNLOADING "Dowload file:"
#related to the internal file viewer:
set ScrollEdits "Scroll to bottom on input"
set EditTitle "TkWine Text Viewer"
set errorTitle "\n*************** TkWine Error ****************\n\
\n An error occured, that I could not resolve. This might be \n\n\
a) An invalid entry \n\
b) An error in the script\n\
In any case, this error should be detected by the script, even an invalid\
entry deserve better error message than this one!!\n\
The following lines are tk output. it might be uninteligible for you, but it makes sense for the maintainers. If you're keen to provide a bug reports, please, send the following info to thirot@univ-brest.fr.\n\n\
(this info can be send in attachement, the file name is /tmp/tkwerror)\n\
In some cases, however, the error is harmless. Feel free to add comment about this when you send me the file. If you want to receive the patch via email, please mention this in your mail. \n\
Sorry not to make it better at once... I'll try to improve. \