Hi
I recently posted a request for a technique to install my mapbasic
routine & associated tables. The replies can be summarised as falling
into three categories...
1. Use WinZip
2. Use installation software such as InstallShield or other available
freeware
3. Write a DOS batch routine.
I investigated each of these. I think that in the long term I will
purchase InstallShield (or some such program). I believe this to be the
most professional approach. However, due to time constraints as much as
anything, in the short term I was keen to keep the learning curve as low
as possible & work with something I understood. So I wrote a DOS batch
routine called from a MapBasic program. I have included this below for
anyone who is interested. If anyone can suggest a simple way to
determine "available drives" (rather than c to z), I would be grateful.
Thanks to the many who responded.
Ian Allan
=========================================
Include "MapBasic.Def"
Declare Sub Main
Declare Sub ExitInstall
'************************************************************************************
Sub Main
'************************************************************************************
Dim
sCdDrive,sPossibleDrives,sSelectedDrive,sCommand1,sCommand2,sCommand3 As
String
Dim i,siSelectedDrive As SmallInt
sCdDrive = Left$(ApplicationDirectory$(),2)
sPossibleDrives = ""
For i = 67 to 90
If i <> Asc(Left$(ApplicationDirectory$(),1)) Then 'Prohibit install
onto the source drive
sPossibleDrives = sPossibleDrives+" "+ Chr$(i)+";"
End If
Next
Dialog Title "Choose Installation Drive" Width 125 Height 25
Control Popupmenu Position 10,5 Title sPossibleDrives Id 1 Into
siSelectedDrive
Control CancelButton Position 45,5 Width 30 height 12 Calling
ExitInstall
Control OKButton Position 85,5 Width 30 height 12 Title
"Install"
siSelectedDrive = siSelectedDrive+66 'Asci # for C drive (66+1=67)
If siSelectedDrive > Asc(Left$(ApplicationDirectory$(),1)) or
siSelectedDrive = Asc(Left$(ApplicationDirectory$(),1)) then
siSelectedDrive=siSelectedDrive+1 'Prohibit install onto the source
drive
If Asc(Left$(ApplicationDirectory$(),1)) < 67 then
siSelectedDrive=siSelectedDrive-1 'Caters for 'A' drive test
End If
End If
sSelectedDrive=Chr$(siSelectedDrive)
' "SourceDirectory" assumes that your CD is setup with the same paths as
you want to install
' You should change "SourceDirectory" to that of your directory name
sCommand1 = "Command.com /c Md "+sSelectedDrive+":\SourceDirectory"
Run Program sCommand1
sCommand2 = "Command.com /c Xcopy "+sCdDrive+"\SourceDirectory
"+sSelectedDrive+":\SourceDirectory /s /e"
Run Program sCommand2
sCommand3 = "Command.com /c Attrib -r
"+sSelectedDrive+":\SourceDirectory /s"
Run Program sCommand3
Note "Installation"+Chr$(10)+"Complete."
End Sub
'************************************************************************************
Sub ExitInstall
'************************************************************************************
End Sub
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]