@@ -41,6 +41,7 @@ static char install_path[MAX_PATH];
4141static const char * src_path = NULL ;
4242static const char * dx_path = NULL ;
4343static const char * ie_path = NULL ;
44+ static const char * tray_patch = NULL ;
4445
4546static BOOL forced_shutdown = FALSE;
4647static BOOL driver_installed = FALSE;
@@ -60,6 +61,15 @@ void setIEpath(const char *ie)
6061 ie_path = ie ;
6162}
6263
64+ void setTrayPath (const char * path_to_tray )
65+ {
66+ static char s_tray_path [MAX_PATH ];
67+ strcpy (s_tray_path , path_to_tray );
68+ strcat (s_tray_path , "\\tray3d.exe" );
69+
70+ tray_patch = s_tray_path ;
71+ }
72+
6373BOOL failure_continue (HWND hwnd )
6474{
6575 static char buf [4096 ] = "Action failure! Continue?" ;
@@ -252,7 +262,7 @@ const char *dirname(const char *full_path)
252262 return buf ;
253263}
254264
255- BOOL install_run (const char * setup_path , HANDLE * pi_proc , HANDLE * pi_thread , BOOL runAndExit )
265+ static BOOL install_run (const char * setup_path , char * cmd_line , HANDLE * pi_proc , HANDLE * pi_thread , BOOL runAndExit )
256266{
257267 STARTUPINFOA si ;
258268 PROCESS_INFORMATION pi ;
@@ -262,7 +272,7 @@ BOOL install_run(const char *setup_path, HANDLE *pi_proc, HANDLE *pi_thread, BOO
262272
263273 si .cb = sizeof (si );
264274
265- if (CreateProcessA (setup_path , NULL , NULL , NULL , FALSE, DETACHED_PROCESS , NULL , dirname (setup_path ), & si , & pi ))
275+ if (CreateProcessA (setup_path , cmd_line , NULL , NULL , FALSE, DETACHED_PROCESS , NULL , dirname (setup_path ), & si , & pi ))
266276 {
267277 * pi_proc = pi .hProcess ;
268278 * pi_thread = pi .hThread ;
@@ -341,13 +351,13 @@ void install_infobox(HWND hwnd, const char *name)
341351BOOL mscv_start (HWND hwnd )
342352{
343353 install_infobox (hwnd , "VC6 redistributable" );
344- return install_run (iniValue ("[softgpu]" , "msvcrtpath" ), & pi_proc , & pi_thread , TRUE);
354+ return install_run (iniValue ("[softgpu]" , "msvcrtpath" ), NULL , & pi_proc , & pi_thread , TRUE);
345355}
346356
347357BOOL dotcom_start (HWND hwnd )
348358{
349359 install_infobox (hwnd , ".COM for Windows 95" );
350- return install_run (iniValue ("[softgpu]" , "dcom95path" ), & pi_proc , & pi_thread , TRUE);
360+ return install_run (iniValue ("[softgpu]" , "dcom95path" ), NULL , & pi_proc , & pi_thread , TRUE);
351361}
352362
353363BOOL ws2_start (HWND hwnd )
@@ -359,7 +369,7 @@ BOOL ws2_start(HWND hwnd)
359369
360370 if (r == IDYES )
361371 {
362- return install_run (iniValue ("[softgpu]" , "ws2path" ), & pi_proc , & pi_thread , TRUE);
372+ return install_run (iniValue ("[softgpu]" , "ws2path" ), NULL , & pi_proc , & pi_thread , TRUE);
363373 }
364374
365375 forced_shutdown = TRUE;
@@ -413,13 +423,19 @@ BOOL dx_start(HWND hwnd)
413423
414424 delete_bad_dx_files ();
415425
416- return install_run (dx_path , & pi_proc , & pi_thread , TRUE);
426+ return install_run (dx_path , NULL , & pi_proc , & pi_thread , TRUE);
417427}
418428
419429BOOL ie_start (HWND hwnd )
420430{
421431 install_infobox (hwnd , "Internet Explorer" );
422- return install_run (ie_path , & pi_proc , & pi_thread , TRUE);
432+ return install_run (ie_path , NULL , & pi_proc , & pi_thread , TRUE);
433+ }
434+
435+ BOOL kill_tray (HWND hwnd )
436+ {
437+ (void )hwnd ;
438+ return install_run (tray_patch , "tray3d.exe /kill" , & pi_proc , & pi_thread , FALSE);
423439}
424440
425441BOOL setup_end (HWND hwnd )
@@ -752,10 +768,11 @@ BOOL filescopy_result(HWND hwnd)
752768 return TRUE;
753769}
754770
755- BOOL setLineSvga (char * buf , size_t bufs )
771+ BOOL setLineSvga (char * buf , size_t bufs , size_t fpos )
756772{
757773 (void )bufs ;
758-
774+ (void )fpos ;
775+
759776 strcpy (buf , "CopyFiles=VMSvga.Copy" );
760777 if (isSettingSet (CHBX_WINE ))
761778 {
@@ -770,10 +787,11 @@ BOOL setLineSvga(char *buf, size_t bufs)
770787 return TRUE;
771788}
772789
773- BOOL setLineVbox (char * buf , size_t bufs )
790+ BOOL setLineVbox (char * buf , size_t bufs , size_t fpos )
774791{
775792 (void )bufs ;
776-
793+ (void )fpos ;
794+
777795 strcpy (buf , "CopyFiles=VBox.Copy" );
778796 if (isSettingSet (CHBX_WINE ))
779797 {
@@ -788,10 +806,11 @@ BOOL setLineVbox(char *buf, size_t bufs)
788806 return TRUE;
789807}
790808
791- BOOL setLineQemu (char * buf , size_t bufs )
809+ BOOL setLineQemu (char * buf , size_t bufs , size_t fpos )
792810{
793811 (void )bufs ;
794-
812+ (void )fpos ;
813+
795814 strcpy (buf , "CopyFiles=Qemu.Copy" );
796815 if (isSettingSet (CHBX_WINE ))
797816 {
@@ -806,9 +825,10 @@ BOOL setLineQemu(char *buf, size_t bufs)
806825 return TRUE;
807826}
808827
809- BOOL setLineSvgaReg (char * buf , size_t bufs )
828+ BOOL setLineSvgaReg (char * buf , size_t bufs , size_t fpos )
810829{
811830 (void )bufs ;
831+ (void )fpos ;
812832
813833 strcpy (buf , "AddReg=VMSvga.AddReg,VM.AddReg,DX.addReg" );
814834
@@ -829,9 +849,10 @@ BOOL setLineSvgaReg(char *buf, size_t bufs)
829849 return TRUE;
830850}
831851
832- BOOL setLineVboxReg (char * buf , size_t bufs )
852+ BOOL setLineVboxReg (char * buf , size_t bufs , size_t fpos )
833853{
834854 (void )bufs ;
855+ (void )fpos ;
835856
836857 strcpy (buf , "AddReg=VBox.AddReg,VM.AddReg,DX.addReg" );
837858
@@ -852,9 +873,10 @@ BOOL setLineVboxReg(char *buf, size_t bufs)
852873 return TRUE;
853874}
854875
855- BOOL setLineQemuReg (char * buf , size_t bufs )
876+ BOOL setLineQemuReg (char * buf , size_t bufs , size_t fpos )
856877{
857878 (void )bufs ;
879+ (void )fpos ;
858880
859881 strcpy (buf , "AddReg=Qemu.AddReg,VM.AddReg,DX.addReg" );
860882
@@ -875,10 +897,11 @@ BOOL setLineQemuReg(char *buf, size_t bufs)
875897 return TRUE;
876898}
877899
878- BOOL setLineMeFix (char * buf , size_t bufs )
900+ BOOL setLineMeFix (char * buf , size_t bufs , size_t fpos )
879901{
880902 (void )bufs ;
881-
903+ (void )fpos ;
904+
882905 if (version_compare (& sysver , & WINVERME ) > 0 &&
883906 isSettingSet (CHBX_WINE ))
884907 {
@@ -896,9 +919,10 @@ BOOL setLineMeFix(char *buf, size_t bufs)
896919 return TRUE;
897920}
898921
899- BOOL setBug565 (char * buf , size_t bufs )
922+ BOOL setBug565 (char * buf , size_t bufs , size_t fpos )
900923{
901924 (void )bufs ;
925+ (void )fpos ;
902926 char * dst = strstr (buf , ",," );
903927 if (dst )
904928 {
@@ -908,9 +932,10 @@ BOOL setBug565(char *buf, size_t bufs)
908932 return FALSE;
909933}
910934
911- BOOL setBugPreferFifo (char * buf , size_t bufs )
935+ BOOL setBugPreferFifo (char * buf , size_t bufs , size_t fpos )
912936{
913937 (void )bufs ;
938+ (void )fpos ;
914939 char * dst = strstr (buf , ",," );
915940 if (dst )
916941 {
@@ -920,9 +945,10 @@ BOOL setBugPreferFifo(char *buf, size_t bufs)
920945 return FALSE;
921946}
922947
923- BOOL setBugDxFlags (char * buf , size_t bufs )
948+ BOOL setBugDxFlags (char * buf , size_t bufs , size_t fpos )
924949{
925950 (void )bufs ;
951+ (void )fpos ;
926952 char * dst = strstr (buf , ",," );
927953 if (dst )
928954 {
@@ -932,9 +958,10 @@ BOOL setBugDxFlags(char *buf, size_t bufs)
932958 return FALSE;
933959}
934960
935- BOOL setLimitVRAM (char * buf , size_t bufs )
961+ BOOL setLimitVRAM (char * buf , size_t bufs , size_t fpos )
936962{
937963 (void )bufs ;
964+ (void )fpos ;
938965 char * dst = strstr (buf , ",," );
939966 if (dst )
940967 {
@@ -990,10 +1017,11 @@ BOOL setLineSyscopy(char *buf, size_t bufs)
9901017}
9911018#endif
9921019
993- BOOL setLine3DFX (char * buf , size_t bufs )
1020+ BOOL setLine3DFX (char * buf , size_t bufs , size_t fpos )
9941021{
9951022 (void )bufs ;
996-
1023+ (void )fpos ;
1024+
9971025 if (isSettingSet (CHBX_3DFX ))
9981026 {
9991027 int line_start = sizeof (";3dfx:" )- 1 ;
@@ -1009,9 +1037,10 @@ BOOL setLine3DFX(char *buf, size_t bufs)
10091037 return TRUE;
10101038}
10111039
1012- BOOL setLineSwitcher (char * buf , size_t bufs )
1040+ BOOL setLineSwitcher (char * buf , size_t bufs , size_t fpos )
10131041{
10141042 (void )bufs ;
1043+ (void )fpos ;
10151044
10161045 BOOL all_on_hal = isSettingSet (RAD_DD_HAL ) && isSettingSet (RAD_D8_HAL ) && isSettingSet (RAD_D9_HAL );
10171046
@@ -1030,9 +1059,10 @@ BOOL setLineSwitcher(char *buf, size_t bufs)
10301059 return TRUE;
10311060}
10321061
1033- BOOL setMesaAlternate (char * buf , size_t bufs )
1062+ BOOL setMesaAlternate (char * buf , size_t bufs , size_t fpos )
10341063{
10351064 (void )bufs ;
1065+ (void )fpos ;
10361066
10371067 if (isSettingSet (CHBX_MESA_ALT ))
10381068 {
@@ -1047,6 +1077,17 @@ BOOL setMesaAlternate(char *buf, size_t bufs)
10471077 return TRUE;
10481078}
10491079
1080+ static size_t del_section_pos = 0 ;
1081+
1082+ BOOL saveDelPos (char * buf , size_t bufs , size_t fpos )
1083+ {
1084+ (void )bufs ;
1085+ (void )buf ;
1086+ del_section_pos = fpos ;
1087+
1088+ return TRUE;
1089+ }
1090+
10501091linerRule_t infFixRules [] = {
10511092 {"CopyFiles=VBox.Copy,Dx.Copy,DX.CopyBackup,Voodoo.Copy" , TRUE, TRUE, setLineVbox },
10521093 {"CopyFiles=VMSvga.Copy,Dx.Copy,DX.CopyBackup,Voodoo.Copy" , TRUE, TRUE, setLineSvga },
@@ -1066,6 +1107,7 @@ linerRule_t infFixRules[] = {
10661107 {"vmwsgl32.dll=1" , TRUE, TRUE, setMesaAlternate },
10671108 {"mesa98.dll=1" , TRUE, TRUE, setMesaAlternate },
10681109 {"mesa99.dll=1" , TRUE, TRUE, setMesaAlternate },
1110+ {"HKR,CURRENT" , TRUE, TRUE, saveDelPos },
10691111 {NULL , FALSE, FALSE, NULL }
10701112};
10711113
@@ -1087,10 +1129,11 @@ BOOL infFixer(HWND hwnd)
10871129 return liner (srcfile , dstfile , infFixRules );
10881130}
10891131
1090- BOOL ignore_line (char * buf , size_t bufs )
1132+ BOOL ignore_line (char * buf , size_t bufs , size_t fpos )
10911133{
10921134 (void )buf ;
10931135 (void )bufs ;
1136+ (void )fpos ;
10941137
10951138 return FALSE;
10961139}
@@ -1170,6 +1213,33 @@ BOOL set_inf_regs(HWND hwnd)
11701213 return TRUE;
11711214}
11721215
1216+ void apply_delete (const char * target )
1217+ {
1218+ char * data ;
1219+ size_t data_size ;
1220+
1221+ if (del_section_pos == 0 )
1222+ return ;
1223+
1224+ if (!truncateFile (target , del_section_pos , & data , & data_size ))
1225+ return ;
1226+
1227+ const char * line = NULL ;
1228+ int index = 0 ;
1229+ for (; (line = iniLine ("[delete]" , index )) != NULL ; index ++ )
1230+ {
1231+ if (line [0 ] == 'H' && line [1 ] == 'K' )
1232+ {
1233+ registryDeleteKeyInf (line , target );
1234+ //addLine(target, line);
1235+ }
1236+ }
1237+
1238+ extendFile (target , data , data_size );
1239+ freeTruncateData (data );
1240+
1241+ }
1242+
11731243BOOL apply_reg_fixes (HWND hwnd )
11741244{
11751245 const char * line = NULL ;
@@ -1181,6 +1251,8 @@ BOOL apply_reg_fixes(HWND hwnd)
11811251 strcpy (dstfile , install_path );
11821252 strcat (dstfile , "\\" );
11831253 strcat (dstfile , iniValue ("[softgpu]" , "drvfile" ));
1254+
1255+ apply_delete (dstfile );
11841256
11851257 //if(version_compare(&sysver, &WINVERME) < 0)
11861258 if (1 ) /* delete in all cases */
0 commit comments