From 6813e58212ebc664c02d7e4dfb9eeeab331cb1d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Sat, 13 Nov 2004 12:43:14 +0000 Subject: [PATCH] feat: logiciel d'installation pour Windows NT/2000/XP --- install/winNT/setup.bpf | 4 ++ install/winNT/setup.bpr | 120 +++++++++++++++++++++++++++++++++++ install/winNT/setup.res | Bin 0 -> 876 bytes install/winNT/setup.tds | Bin 0 -> 65536 bytes install/winNT/unit1.cpp | 135 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 259 insertions(+) create mode 100644 install/winNT/setup.bpf create mode 100644 install/winNT/setup.bpr create mode 100644 install/winNT/setup.res create mode 100644 install/winNT/setup.tds create mode 100644 install/winNT/unit1.cpp diff --git a/install/winNT/setup.bpf b/install/winNT/setup.bpf new file mode 100644 index 0000000..6967230 --- /dev/null +++ b/install/winNT/setup.bpf @@ -0,0 +1,4 @@ +This file is used by the project manager only and should be treated like the project file + + +main \ No newline at end of file diff --git a/install/winNT/setup.bpr b/install/winNT/setup.bpr new file mode 100644 index 0000000..b67fc36 --- /dev/null +++ b/install/winNT/setup.bpr @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[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= + + \ No newline at end of file diff --git a/install/winNT/setup.res b/install/winNT/setup.res new file mode 100644 index 0000000000000000000000000000000000000000..53d1accc46d0945afe50cda57289ae401923c1fa GIT binary patch literal 876 zcmb_bu}Z{15S{3iB3E2*N=xBd!N>)Ih58qMf?H&Zl!3edxgt%9gEaFQ78Z-Yu)epO zy^BT=!AIWCyq$ToA!J2Fa?txoq+jrUmg?u|$wFZmnzf z51ktJx=uSS%K~fEMvay)h1R3yAZqNR*91Rx^m4D$%|7Za>hxEy(N7N>lb;@*pZwHQ zKXt3ER`%QZdOZJwc!Opy&O3;dL$wcI0J?@&GnlB`P-kn@NLUAY0bJBf1H$Yieu;ht zxx&A3q96w`CXqkuA9$O2neqlRRI9TftkD F$tNfOCK><$ literal 0 HcmV?d00001 diff --git a/install/winNT/setup.tds b/install/winNT/setup.tds new file mode 100644 index 0000000000000000000000000000000000000000..5ae5c8e2bc3dcf02d98a8b800c2b36542d68c6db GIT binary patch literal 65536 zcmeI&&2G~`5Ww**QbqX?f&x8Ma0^$|M@Zu)Z6s4gv?|>oISR zy&-@A0tg_000IagfB*srAb@~+qJFAR;;@q)`1sjWh1we)+nAavjzcKJSq#oE2RCcA ztqbG4daboizMiN0B1!esyQuayBI$IbQ|GVE(yIMo73ag+XQp0WMQxkRuA(b_TkMUz zlbJl%(T2i#6Rq0)9jd);RyK=vE+w>!>TNsVY<53D>Z+(-NwAMhacwK#CHF19*y1qH%k090O0~)T>wWU~OUZ8g_rW&j z%>A(H!%z>BlZ#{^2!C3&f*aM!8es$GeX8y7d??a}m0+3$(*^IRm_d(bp98>&)_UA$9IwO$nE+^XmDMG)IF zXiq8D;j*0MrHSf=)|HJWEZ17M3q6-BAj@oX(cO+NNA7`i(<_-=M!5Yu)>pHBy^?Bt z5I_I{1Q0*~0R#|0009IZ6lj0{-&NaP9{&Y+kc$Ka5I_I{1Q0*~0R#|0009ILKmY** z5I_I{1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|0 z009ILKmY**5I_I{1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|0009ILKmY**5I_I{ z1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|0009IL zKmY**5I_I{1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|0009ILKmY**5I_I{1Q0*~ h0R#|0009ILKmY**5I_I{1Q0*~f&UgbI8 +#include +#include +#include +#include +#include +#include +#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; +} +//---------------------------------------------------------------------------