feat: version bêta 1.3.2fr

This commit is contained in:
Nicolas Hordé 2007-03-31 18:49:53 +00:00
parent f86bd67d51
commit 2eee63e178
16 changed files with 994 additions and 0 deletions

20
install/MAKEFILE Normal file
View File

@ -0,0 +1,20 @@
asm= lzasm /z/t
lnk= elink
all: setup.com
setup.com: setup.obj
$(lnk) setup.obj setup.com /c
setup.obj:
$(asm) setup.asm
clean:
del *.obj
del *.exe
del *.bak
del *.lib
del *.com
del *.bin
del *.sys
del *.err

164
install/setup.asm Normal file
View File

@ -0,0 +1,164 @@
model tiny,stdcall
p486
locals
jumps
codeseg
option procalign:byte
org 0100h
ent equ 32h
jmp copycos
message db 0Dh,0Ah,'COS 2000 V1.3.1BetaFr programme d''installation',0Dh,0AH,'Inserez une disquette formatee et appuyez sur entre...',0Dh,0AH,'Attention le contenu de celle ci peut etre altere !!!',0Dh,0AH,'$'
message2 db 0Dh,0AH,'Creation du secteur de demarrage...',0Dh,0Ah,'$'
message3 db 0Dh,0AH,'Copie des fichiers systeme...',0Dh,0Ah,'$'
errormsg db 0Dh,0AH,'Erreur d''installation, contactez moi a COS2000@MULTIMANIA.COM !',0Dh,0AH,'$'
ok db 0Dh,0AH,'COS2000 a ete correctement installe, veuillez redemarrer votre PC',0Dh,0AH,'$'
files db '*.*',0
boot db 'boot.bin',0
dat db 'data',0
retu db 0Dh,0AH,'$'
dta db 43 dup (0)
copycos:
mov ah,9
mov dx,offset message
int 21h
xor ax,ax
int 16h
mov ah,4ah
mov bx,1000h
int 21h
jc error
mov ah,48h
mov bx,65536/16
int 21h
jc error
mov fs,ax
mov ah,3Bh
mov dx,offset dat
int 21h
jc error
mov ah,1Ah
mov dx,offset dta
int 21h
jc error
mov ah,4eh
xor cx,cx
mov dx,offset files
int 21h
jc error
mov ah,09
mov dx,offset message3
int 21h
allfile:
mov [byte ptr offset dta+43],'$'
mov ah,9
mov dx,offset dta+30
int 21h
push dx
mov ah,09
mov dx,offset retu
int 21h
pop dx
mov ax,3D00h
int 21h
jc error
mov bx,ax
mov ax,4202h
xor cx,cx
xor dx,dx
int 21h
jc error
cmp dx,0
jne error
cmp ax,0
je error
mov bp,ax
mov ax,4200h
xor cx,cx
xor dx,dx
int 21h
jc error
push fs
pop ds
mov ah,3fh
mov cx,0FFFFh
xor dx,dx
int 21h
push cs
pop ds
jc error
mov ah,3eh
int 21h
jc error
mov ah,3ch
push cs
pop es
mov di,offset dta+30-3
mov [word ptr di],":a"
mov [byte ptr di+2],"\"
xor cx,cx
mov dx,di
int 21h
jc error
mov bx,ax
push fs
pop ds
xor dx,dx
mov ah,40h
mov cx,bp
int 21h
push cs
pop ds
jc error
mov ah,3eh
int 21h
jc error
mov ah,4fh
int 21h
jnc allfile
mov ah,09
mov dx,offset message2
int 21h
mov ax,3D00h
mov dx,offset boot
int 21h
jc error
push fs
pop ds
mov ah,3fh
mov cx,0FFFFh
xor dx,dx
int 21h
push cs
pop ds
jc error
mov ah,3eh
int 21h
jc error
push fs
pop es
mov ax,0301h
mov dx,0
mov cx,0001h
xor bx,bx
int 13h
mov ah,09
mov dx,offset ok
int 21h
xor ax,ax
int 16h
ret
error:
mov ah,09
mov dx,offset errormsg
int 21h
xor ax,ax
int 16h
ret

BIN
install/setup.sh Executable file

Binary file not shown.

121
install/winNT gui/setup.bpr Normal file
View File

@ -0,0 +1,121 @@
<?xml version='1.0' encoding='utf-8' ?>
<!-- C++Builder XML Project -->
<PROJECT>
<MACROS>
<VERSION value="BCB.06.00"/>
<PROJECT value="setup.exe"/>
<OBJFILES value="setup.obj Unit1.obj"/>
<RESFILES value="setup.res"/>
<IDLFILES value=""/>
<IDLGENFILES value=""/>
<DEFFILE value=""/>
<RESDEPEN value="$(RESFILES) Unit1.dfm"/>
<LIBFILES value=""/>
<LIBRARIES value="rtl.lib vcl.lib"/>
<SPARELIBS value="vcl.lib rtl.lib"/>
<PACKAGES value="vcl.bpi rtl.bpi dbrtl.bpi adortl.bpi vcldb.bpi vclx.bpi bdertl.bpi
vcldbx.bpi ibxpress.bpi dsnap.bpi cds.bpi bdecds.bpi qrpt.bpi teeui.bpi
teedb.bpi tee.bpi dss.bpi teeqr.bpi visualclx.bpi visualdbclx.bpi
dsnapcrba.bpi dsnapcon.bpi bcbsmp.bpi vclie.bpi xmlrtl.bpi inet.bpi
inetdbbde.bpi inetdbxpress.bpi inetdb.bpi nmfast.bpi webdsnap.bpi
bcbie.bpi websnap.bpi soaprtl.bpi dclocx.bpi dbexpress.bpi dbxcds.bpi
indy.bpi bcb2kaxserver.bpi pop.bpi IcsBcb50.bpi bcbshlctrls.bpi"/>
<PATHCPP value=".;"/>
<PATHPAS value=".;"/>
<PATHRC value=".;"/>
<PATHASM value=".;"/>
<DEBUGLIBPATH value="$(BCB)\lib\debug"/>
<RELEASELIBPATH value="$(BCB)\lib\release"/>
<LINKER value="ilink32"/>
<USERDEFINES value=""/>
<SYSDEFINES value="_RTLDLL;NO_STRICT"/>
<MAINSOURCE value="setup.cpp"/>
<INCLUDEPATH value="E:\CBuilder6\Projects;&quot;C:\Documents and Settings\niko\Bureau\Nouveau dossier&quot;;$(BCB)\include;$(BCB)\include\vcl"/>
<LIBPATH value="E:\CBuilder6\Projects;&quot;C:\Documents and Settings\niko\Bureau\Nouveau dossier&quot;;$(BCB)\Projects\Lib;$(BCB)\lib\obj;$(BCB)\lib"/>
<WARNINGS value="-w-par"/>
<OTHERFILES value=""/>
</MACROS>
<OPTIONS>
<IDLCFLAGS value="-IE:\CBuilder6\Projects
-I&quot;C:\Documents and Settings\niko\Bureau\Nouveau dossier&quot; -I$(BCB)\include
-I$(BCB)\include\vcl -src_suffix cpp -boa"/>
<CFLAG1 value="-O2 -H=$(BCB)\lib\vcl60.csm -Hc -w- -Vx -Ve -X- -a8 -b- -k- -vi -c -tW -tWM"/>
<PFLAGS value="-$Y- -$L- -$D- -$A8 -v -JPHNE -M"/>
<RFLAGS value=""/>
<AFLAGS value="/mx /w2 /zn"/>
<LFLAGS value="-D&quot;&quot; -aa -Tpe -x -Gn"/>
<OTHERFILES value=""/>
</OPTIONS>
<LINKER>
<ALLOBJ value="c0w32.obj Memmgr.Lib sysinit.obj $(OBJFILES)"/>
<ALLRES value="$(RESFILES)"/>
<ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib"/>
<OTHERFILES value=""/>
</LINKER>
<FILELIST>
<FILE FILENAME="setup.res" FORMNAME="" UNITNAME="setup.res" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="setup.cpp" FORMNAME="" UNITNAME="setup" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="Unit1.cpp" FORMNAME="Form1" UNITNAME="Unit1" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
</FILELIST>
<BUILDTOOLS>
</BUILDTOOLS>
<IDEOPTIONS>
[Version Info]
IncludeVerInfo=0
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1036
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
[Debugging]
DebugSourceDirs=$(BCB)\source\vcl
[Parameters]
RunParams=
Launcher=
UseLauncher=0
DebugCWD=
HostApplication=
RemoteHost=
RemotePath=
RemoteLauncher=
RemoteCWD=
RemoteDebug=0
[Compiler]
ShowInfoMsgs=0
LinkDebugVcl=0
LinkCGLIB=0
[CORBA]
AddServerUnit=1
AddClientUnit=1
PrecompiledHeaders=1
[Language]
ActiveLang=
ProjectLang=
RootDir=
</IDEOPTIONS>
</PROJECT>

View File

@ -0,0 +1,33 @@
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
//---------------------------------------------------------------------------
USEFORM("Unit1.cpp", Form1);
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
Application->CreateForm(__classid(TForm1), &Form1);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
catch (...)
{
try
{
throw Exception("");
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
}
return 0;
}
//---------------------------------------------------------------------------

BIN
install/winNT gui/setup.res Normal file

Binary file not shown.

BIN
install/winNT gui/setup.tds Normal file

Binary file not shown.

166
install/winNT gui/unit1.cpp Normal file
View File

@ -0,0 +1,166 @@
//---------------------------------------------------------------------------
#include <vcl.h>
#include <winioctl.h>
#include <io.h>
#include <fcntl.h>
#include <dir.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
HANDLE hDrive;
DISK_GEOMETRY dg_flop_geom;
AnsiString lecteur="b:";
AnsiString device="\\\\.\\"+lecteur;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
char * GetLastErrorString(void)
{
LPVOID lpMsgBuf;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf, 0, NULL);
return (char *)lpMsgBuf;
}
//---------------------------------------------------------------------------
ShowMessages(AnsiString msg)
{
Form1->Memo1->Lines->Add(msg);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormShow(TObject *Sender)
{
DWORD dwNotUsed;
DWORD error=0;
hDrive = CreateFile(device.c_str(), GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,NULL);
ShowMessages("Ouverture du peripherique "+lecteur);
if (hDrive == INVALID_HANDLE_VALUE) {
ShowMessages("Erreur : "+AnsiString(GetLastErrorString()));
error=1;
}
if(error!=1&&ShowMessages("Determination de la geometrie ")&&DeviceIoControl(hDrive, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL,0, &dg_flop_geom, sizeof(dg_flop_geom),&dwNotUsed, NULL) == FALSE) {
ShowMessages("Erreur : "+AnsiString(GetLastErrorString()));
error=1;
}
if(error!=1&&(dg_flop_geom.MediaType==FixedMedia||dg_flop_geom.MediaType==RemovableMedia||dg_flop_geom.MediaType==Unknown))
{
ShowMessages("Erreur : Ceci n'est pas une disquette !");
error=1;
}
if (error!=1&&ShowMessages("Positionnement sur le secteur 0")&&SetFilePointer(hDrive, 0, NULL, FILE_BEGIN) == -1) {
ShowMessages("Erreur : "+AnsiString(GetLastErrorString()));
error=1;
}
if (error!=1)
{
drive->Caption=lecteur.UpperCase();
track->Caption=IntToStr(dg_flop_geom.Cylinders.LowPart);
sector->Caption=IntToStr(dg_flop_geom.SectorsPerTrack);
size->Caption=IntToStr(dg_flop_geom.BytesPerSector);
head->Caption=IntToStr(dg_flop_geom.TracksPerCylinder);
allsize->Caption=IntToStr(dg_flop_geom.BytesPerSector*dg_flop_geom.Cylinders.LowPart*dg_flop_geom.SectorsPerTrack*dg_flop_geom.TracksPerCylinder);
allsector->Caption=IntToStr(dg_flop_geom.Cylinders.LowPart*dg_flop_geom.SectorsPerTrack*dg_flop_geom.TracksPerCylinder);
}
else
{
CloseHandle(hDrive);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
if (hDrive == NULL||dg_flop_geom.TracksPerCylinder>2||dg_flop_geom.TracksPerCylinder==0)
{
ShowMessages("Aucun support valide detecté !");
}
else
{
int fdboot;
DWORD error=0;
DWORD dwBsWritten;
char * buffer;
AnsiString bootfile="data/boot.bin";
ShowMessages("Allocation de mémoire ");
buffer = (char *)malloc(dg_flop_geom.BytesPerSector);
ShowMessages("Ouverture et installation du fichier de boot "+bootfile);
if ((fdboot = _rtl_open(bootfile.c_str(),O_RDONLY | O_BINARY)) == -1 )
{
ShowMessages("Erreur : Fichier de boot introuvable");
error=1;
}
if (error!=1&&_read(fdboot, buffer, dg_flop_geom.BytesPerSector)!= dg_flop_geom.BytesPerSector)
{
ShowMessages("Erreur : Fichier de boot de taille incorrecte !");
error=1;
}
if (error!=1&&WriteFile(hDrive, buffer, dg_flop_geom.BytesPerSector, &dwBsWritten, NULL) == 0)
{
ShowMessages("Ecriture impossible sur le secteur de boot !");
error=1;
}
_rtl_close(fdboot);
if (error!=1)
{
struct ffblk files;
int done;
int number=0;
ShowMessages("Détermination des fichiers a copier");
done = findfirst("data/*.*",&files,0);
while (!done)
{
number++;
done = findnext(&files);
}
install->Max=number;
install->Min=0;
install->Position=0;
ShowMessages("Copie des fichiers de cos2000");
done = findfirst("data/*.*",&files,0);
while (!done)
{
ShowMessages(AnsiString(files.ff_name).LowerCase());
if (!CopyFile((AnsiString("data/")+AnsiString(files.ff_name)).c_str(),(lecteur+"\\"+AnsiString(files.ff_name)).c_str(),false))
{
ShowMessages("Erreur : fichier impossible a copier"+AnsiString(GetLastErrorString()));
error=1;
break;
}
done = findnext(&files);
install->Position++;
}
if (!error)
{
ShowMessages("Installation terminée !");
Button2->Visible=false;
Button1->Visible=false;
Button3->Visible=true;
}
else
ShowMessages("Installation echoué !");
}
free(buffer);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
CloseHandle(hDrive);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------

BIN
install/winNT gui/unit1.ddp Normal file

Binary file not shown.

184
install/winNT gui/unit1.dfm Normal file
View File

@ -0,0 +1,184 @@
object Form1: TForm1
Left = 418
Top = 273
Width = 599
Height = 371
Caption = 'Installation de COS2000'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
OnClose = FormClose
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object Button1: TButton
Left = 288
Top = 304
Width = 75
Height = 25
Caption = 'installer...'
TabOrder = 0
OnClick = Button1Click
end
object install: TProgressBar
Left = 16
Top = 264
Width = 553
Height = 25
Min = 0
Max = 100
TabOrder = 1
end
object Button2: TButton
Left = 208
Top = 304
Width = 75
Height = 25
Caption = 'support'
TabOrder = 2
OnClick = FormShow
end
object Memo1: TMemo
Left = 192
Top = 24
Width = 377
Height = 225
ReadOnly = True
TabOrder = 3
end
object GroupBox1: TGroupBox
Left = 16
Top = 120
Width = 161
Height = 129
Caption = 'G'#233'om'#233'trie'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentFont = False
TabOrder = 4
object track: TLabel
Left = 96
Top = 60
Width = 31
Height = 13
Caption = 'Aucun'
end
object Label4: TLabel
Left = 24
Top = 60
Width = 34
Height = 13
Caption = 'Pistes :'
end
object Label5: TLabel
Left = 24
Top = 28
Width = 48
Height = 13
Caption = 'Secteurs :'
end
object sector: TLabel
Left = 96
Top = 28
Width = 31
Height = 13
Caption = 'Aucun'
end
object head: TLabel
Left = 96
Top = 44
Width = 31
Height = 13
Caption = 'Aucun'
end
object Label6: TLabel
Left = 24
Top = 44
Width = 33
Height = 13
Caption = 'Tetes :'
end
object Label8: TLabel
Left = 24
Top = 84
Width = 69
Height = 13
Caption = 'Taille secteur :'
end
object size: TLabel
Left = 96
Top = 84
Width = 31
Height = 13
Caption = 'Aucun'
end
end
object GroupBox2: TGroupBox
Left = 16
Top = 16
Width = 161
Height = 97
Caption = 'Support'
TabOrder = 5
object Label1: TLabel
Left = 24
Top = 24
Width = 42
Height = 13
Caption = 'Lecteur :'
end
object drive: TLabel
Left = 88
Top = 24
Width = 31
Height = 13
Caption = 'Aucun'
end
object Label2: TLabel
Left = 24
Top = 40
Width = 31
Height = 13
Caption = 'Taille :'
end
object allsize: TLabel
Left = 88
Top = 40
Width = 31
Height = 13
Caption = 'Aucun'
end
object Label3: TLabel
Left = 24
Top = 56
Width = 58
Height = 13
Caption = 'N'#176'secteurs :'
end
object allsector: TLabel
Left = 88
Top = 56
Width = 31
Height = 13
Caption = 'Aucun'
end
end
object Button3: TButton
Left = 248
Top = 304
Width = 75
Height = 25
Caption = 'Quitter'
TabOrder = 6
Visible = False
OnClick = Button3Click
end
end

47
install/winNT gui/unit1.h Normal file
View File

@ -0,0 +1,47 @@
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TButton *Button1;
TProgressBar *install;
TButton *Button2;
TMemo *Memo1;
TGroupBox *GroupBox1;
TLabel *track;
TLabel *Label4;
TLabel *Label5;
TLabel *sector;
TLabel *head;
TLabel *Label6;
TLabel *Label8;
TLabel *size;
TGroupBox *GroupBox2;
TLabel *Label1;
TLabel *drive;
TLabel *Label2;
TLabel *allsize;
TLabel *Label3;
TLabel *allsector;
TButton *Button3;
void __fastcall FormShow(TObject *Sender);
void __fastcall Button1Click(TObject *Sender);
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
void __fastcall Button3Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif

4
install/winNT/setup.bpf Normal file
View File

@ -0,0 +1,4 @@
This file is used by the project manager only and should be treated like the project file
main

120
install/winNT/setup.bpr Normal file
View File

@ -0,0 +1,120 @@
<?xml version='1.0' encoding='utf-8' ?>
<!-- C++Builder XML Project -->
<PROJECT>
<MACROS>
<VERSION value="BCB.06.00"/>
<PROJECT value="setup.exe"/>
<OBJFILES value="Unit1.obj"/>
<RESFILES value="Setup.res"/>
<IDLFILES value=""/>
<IDLGENFILES value=""/>
<DEFFILE value=""/>
<RESDEPEN value="$(RESFILES)"/>
<LIBFILES value=""/>
<LIBRARIES value=""/>
<SPARELIBS value=""/>
<PACKAGES value="vcl.bpi rtl.bpi dbrtl.bpi adortl.bpi vcldb.bpi vclx.bpi bdertl.bpi
vcldbx.bpi ibxpress.bpi dsnap.bpi cds.bpi bdecds.bpi qrpt.bpi teeui.bpi
teedb.bpi tee.bpi dss.bpi teeqr.bpi visualclx.bpi visualdbclx.bpi
dsnapcrba.bpi dsnapcon.bpi bcbsmp.bpi vclie.bpi xmlrtl.bpi inet.bpi
inetdbbde.bpi inetdbxpress.bpi inetdb.bpi nmfast.bpi webdsnap.bpi
bcbie.bpi websnap.bpi soaprtl.bpi dclocx.bpi dbexpress.bpi dbxcds.bpi
indy.bpi bcb2kaxserver.bpi pop.bpi IcsBcb50.bpi bcbshlctrls.bpi"/>
<PATHCPP value=".;"/>
<PATHPAS value=".;"/>
<PATHRC value=".;"/>
<PATHASM value=".;"/>
<DEBUGLIBPATH value="$(BCB)\lib\debug"/>
<RELEASELIBPATH value="$(BCB)\lib\release"/>
<LINKER value="ilink32"/>
<USERDEFINES value=""/>
<SYSDEFINES value="NO_STRICT;_NO_VCL;_RTLDLL"/>
<MAINSOURCE value="Setup.bpf"/>
<INCLUDEPATH value="&quot;..\Nouveau dossier (2)&quot;;$(BCB)\include;$(BCB)\include\vcl"/>
<LIBPATH value="&quot;..\Nouveau dossier (2)&quot;;$(BCB)\Projects\Lib;$(BCB)\lib\obj;$(BCB)\lib"/>
<WARNINGS value="-w-par"/>
<OTHERFILES value=""/>
</MACROS>
<OPTIONS>
<IDLCFLAGS value="-I&quot;..\Nouveau dossier (2)&quot; -I$(BCB)\include -I$(BCB)\include\vcl
-src_suffix cpp -boa"/>
<CFLAG1 value="-O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- -k- -vi -tWC -tWM- -c"/>
<PFLAGS value="-$Y- -$L- -$D- -$A8 -v -JPHNE -M"/>
<RFLAGS value=""/>
<AFLAGS value="/mx /w2 /zn"/>
<LFLAGS value="-D&quot;&quot; -ap -Tpe -x -Gn"/>
<OTHERFILES value=""/>
</OPTIONS>
<LINKER>
<ALLOBJ value="c0x32.obj $(OBJFILES)"/>
<ALLRES value="$(RESFILES)"/>
<ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cw32i.lib"/>
<OTHERFILES value=""/>
</LINKER>
<FILELIST>
<FILE FILENAME="Setup.res" FORMNAME="" UNITNAME="Setup.res" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="Setup.bpf" FORMNAME="" UNITNAME="Setup" CONTAINERID="BPF" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="Unit1.cpp" FORMNAME="" UNITNAME="Unit1" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
</FILELIST>
<BUILDTOOLS>
</BUILDTOOLS>
<IDEOPTIONS>
[Version Info]
IncludeVerInfo=0
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1036
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
[Debugging]
DebugSourceDirs=$(BCB)\source\vcl
[Parameters]
RunParams=
Launcher=
UseLauncher=0
DebugCWD=
HostApplication=
RemoteHost=
RemotePath=
RemoteLauncher=
RemoteCWD=
RemoteDebug=0
[Compiler]
ShowInfoMsgs=0
LinkDebugVcl=0
LinkCGLIB=0
[CORBA]
AddServerUnit=1
AddClientUnit=1
PrecompiledHeaders=1
[Language]
ActiveLang=
ProjectLang=
RootDir=
</IDEOPTIONS>
</PROJECT>

BIN
install/winNT/setup.res Normal file

Binary file not shown.

BIN
install/winNT/setup.tds Normal file

Binary file not shown.

135
install/winNT/unit1.cpp Normal file
View File

@ -0,0 +1,135 @@
//---------------------------------------------------------------------------
#include <windows.h>
#include <winbase.h>
#include <winioctl.h>
#include <io.h>
#include <stdio.h>
#include <fcntl.h>
#include <dir.h>
#pragma hdrstop
//---------------------------------------------------------------------------
char * GetLastErrorString(void)
{
LPVOID lpMsgBuf;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf, 0, NULL);
return (char *)lpMsgBuf;
}
#pragma argsused
int main(int argc, char* argv[])
{
DWORD dwNotUsed;
DWORD error=0;
HANDLE hDrive;
DISK_GEOMETRY dg_flop_geom;
char lecteur[4]="a:\0";
char device[7]="\\\\.\\a:\0";
int fdboot;
DWORD dwBsWritten;
char * buffer;
char bootfile[14]="data/boot.bin\0";
struct ffblk files;
int done;
int number=0;
char src[80];
char dest[80];
printf("Installation de COS2000\nInserez une disquette et appuyer sur une touche...\n");
getchar();
hDrive = CreateFile(device, GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,NULL);
printf("Ouverture du peripherique %s\n",lecteur);
if (hDrive == INVALID_HANDLE_VALUE) {
printf("Erreur : %s\n",GetLastErrorString());
error=1;
}
if(error!=1&&printf("Determination de la geometrie \n")&&DeviceIoControl(hDrive, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL,0, &dg_flop_geom, sizeof(dg_flop_geom),&dwNotUsed, NULL) == FALSE) {
printf("Erreur : %s\n",GetLastErrorString());
error=1;
}
if(error!=1&&(dg_flop_geom.MediaType==FixedMedia||dg_flop_geom.MediaType==RemovableMedia||dg_flop_geom.MediaType==Unknown))
{
printf("Erreur : Ceci n'est pas une disquette !\n");
error=1;
}
if (error!=1&&printf("Positionnement sur le secteur 0\n")&&SetFilePointer(hDrive, 0, NULL, FILE_BEGIN) == -1) {
printf("Erreur : %s\n",GetLastErrorString());
error=1;
}
if (error!=1)
{
printf("Pistes :%u Secteurs:%u Tetes:%u Taille:%u\n",dg_flop_geom.Cylinders.LowPart,dg_flop_geom.SectorsPerTrack,dg_flop_geom.TracksPerCylinder,dg_flop_geom.BytesPerSector);
}
else
{
CloseHandle(hDrive);
}
if (hDrive == NULL||dg_flop_geom.TracksPerCylinder>2||dg_flop_geom.TracksPerCylinder==0)
{
printf("Aucun support valide detecte !");
error=1;
}
if (error!=1)
{
printf("Allocation de memoire\n");
buffer = (char *)malloc(dg_flop_geom.BytesPerSector);
printf("Ouverture et installation du fichier de boot %s\n",bootfile);
}
if (error!=1&&(fdboot = _rtl_open(bootfile,O_RDONLY | O_BINARY)) == -1 )
{
printf("Erreur : Fichier de boot introuvable\n");
error=1;
}
if (error!=1&&_read(fdboot, buffer, dg_flop_geom.BytesPerSector)!= dg_flop_geom.BytesPerSector)
{
printf("Erreur : Fichier de boot de taille incorrecte !\n");
error=1;
}
if (error!=1&&WriteFile(hDrive, buffer, dg_flop_geom.BytesPerSector, &dwBsWritten, NULL) == 0)
{
printf("Ecriture impossible sur le secteur de boot !\n");
error=1;
}
if (error!=1)
{
_rtl_close(fdboot);
printf("Determination des fichiers a copier\n\n");
done = findfirst("data\\*.*",&files,0);
while (!done)
{
number++;
done = findnext(&files);
}
printf("Copie des fichiers de cos2000\n");
done = findfirst("data\\*.*",&files,0);
while (!done)
{
printf("%s\n",files.ff_name);
sprintf(src, "data\\%s",files.ff_name);
sprintf(dest, "%s\\%s",lecteur,files.ff_name);
if (!CopyFile(src,dest,false))
{
printf("Erreur : fichier impossible a copier %s\n",GetLastErrorString());
error=1;
break;
}
done = findnext(&files);
}
if (!error)
{
printf("Installation terminee !\nVeuillez redemarrer votre PC afin de charger le systeme");
}
else
{
printf("Installation echoué !");
}
free(buffer);
}
getchar();
return 0;
}
//---------------------------------------------------------------------------