home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 1999 May / CDROM.ISO / setup / setupprg.mnu < prev    next >
Encoding:
Text File  |  1999-03-22  |  28.6 KB  |  1,063 lines

  1. start main
  2.  
  3. ; NOTE: This file needs LSETUP >= v1.4 !!!
  4.  
  5. ourSSversion: string {"1"}
  6. saneSSversion: string {"1"}
  7.  
  8. ;TESTING:        void  ; uncomment this for the final release !
  9. ;FINAL_TEST:     void  ; uncomment this for the final release !
  10.  
  11. ;DO_KBD_REQUEST:  void  ; uncomment this, if 'kbd=xxx' should be reported
  12.                        ; to the kernel
  13.  
  14. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  15. ;@@@@@@@@@@@@@@@@@@@@@@@  CONFIGURATION  @@@@@@@@@@@@@@@@@@@@@@@@@@@@
  16. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  17.  
  18.  
  19. ;         +---- normattrib
  20. ;         |     +-- inversattrib
  21. ;         |     |     +-- highlightattrib
  22. ;         |     |     |     +-- frameattrib
  23. ;colors (0x0f, 0x6f, 0x10, 0x07, 0x07, 0x70, 0x0f, 0x07) ; standard set, black background
  24. ;              the same for MDA---^-----^-----^-----^
  25. colors (0x70, 0x0e, 0x0e, 0x70, 0x07, 0x70, 0x0f, 0x07)    ; light background, a little color
  26. ;colors (0x70, 0x0f, 0xf0, 0x7f, 0x07, 0x70, 0x0f, 0x07)    ; light background, no color
  27. ;colors (0x07, 0x70, 0x0f, 0x07, 0x07, 0x70, 0x0f, 0x07)    ; for MDA, Hercules
  28.  
  29.  
  30.  
  31. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  32. ;@@@@@@@@@@@@@@@@@@@@@@@@@  MENU PART  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  33. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  34.  
  35.  
  36.  
  37. ;===========================================================================
  38.  
  39. main_log_colum:     string {"44"}
  40.  
  41. main:  menu (0,0,80,3,0) {
  42.   image { tx_headline }
  43.   action {
  44.     show ( main2 )
  45.   }
  46. }
  47.  
  48. ; Main window body
  49.  
  50. main2: menu (0,2,80,25-2,1) {
  51.  
  52.   image { tx_main2 }
  53.  
  54.   action {
  55.     call initstuff()
  56.     call show_startup_help()
  57.  
  58.       ; now we are starting the main menu-engine
  59.       ; Each menu-job is setting <nextjob> to point to
  60.       ; the next routine that should be executed.
  61.       ; If all work is done, the last job calls exit.
  62. ;    set nextjob = "check_if_GT_4Mb"
  63.     set nextjob = "loadlin_or_floppy_menu"
  64.  
  65.   mainloop:
  66.     call nextjob()
  67.     goto mainloop
  68.  
  69.   }
  70. }
  71.  
  72.  
  73.  
  74. ;------------------- main menu subroutines ------------------------
  75.  
  76. ;------------------
  77. initstuff: function {
  78.  
  79.        ; we check if we got the right SUSESAVE
  80.   set work1 = SSversion
  81.   iferror goto no_preset
  82.   call numbercmp(">=",SSversion,saneSSversion)
  83.   iffalse exit(tx_wrong_SUSESAVE)
  84. no_preset:
  85.        ; we are getting the default drive and print it on screen
  86.   call get_default_drive(drive)
  87.   printxy (main_log_colum,4,drive)
  88.   printxy (main_log_colum,5,distribution)   ; kind of distribution
  89.  
  90.        ; Now we ask for the CDrom drive letter
  91.   set answerstring = drive ; preset it, so <enter> would return drive
  92.   set answerstring = SSdrive  ; preset from susesave.mnu
  93.   set querystring = tx_initstuff
  94.   call strcat(querystring, drive);
  95.   show ( enter_char, querystring )
  96.        ; and update it on screen
  97.   call sprintf(drive,"%s:",answerstring)
  98.   printxy (main_log_colum,4,drive)
  99.   call createvar(SSdrive,drive)
  100.        ;now update the pathes that we need later
  101.   call strprefix(distribCDpath,drive)
  102.        ;we check for W'95
  103.   call W95check()
  104. }
  105.  
  106.  
  107. ;------------------
  108. W95check: function {
  109.   set tx_no9000page = tx_no9000page_normal
  110.   call getenv(work1,"winbootdir")
  111.   iffalse return(0)
  112.   call sprintf(work2, "%s\\command\\xcopy32.exe", work1)
  113.   call existfile(work2)
  114.   iffalse return(0)
  115.   set tx_no9000page = tx_no9000page_W95
  116.   call return(1)
  117. }
  118.  
  119. ;-----------------
  120. show_startup_help: function {
  121.   ; now we can show up our litle startup help file
  122.   call sprintf(filestr, helpfile_on_CD, distribCDpath)
  123.   show ( showfile_menu )
  124. }
  125.  
  126.  
  127.  
  128. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  129. ;@@@@@@@@@@@@@@@@@@@@@  INSTALLATION JOBS  @@@@@@@@@@@@@@@@@@@@@@@@@@
  130. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  131.  
  132.  
  133. ;-----------------
  134. check_if_GT_4Mb: function {
  135.  
  136.   set nextjob = "cancelinstall"
  137.   call sysinfo(work1)
  138.   call strcpyitem(work2, work1 , 2)
  139.   call numbercmp("=", work2, 0)
  140.   iffalse goto is_not_64mb
  141.   set work2 = "65536"
  142. is_not_64mb:
  143.   set answerstring = work2
  144.   set answerstring = SSmem  ; preset from susesave.mnu
  145.   set work3 = ( work2 / 1024 )
  146.   call sprintf(work1, tx_check_if_GT_4Mb ,work2, work3 )
  147.   show (enter_string, work1)
  148.   call createvar(SSmem,answerstring)
  149.   call numbercmp("<", answerstring, 1024)
  150.   iffalse goto is_in_kbyte
  151.   set answerstring = ( answerstring * 1024 )
  152.  
  153. is_in_kbyte:
  154.   call numbercmp("=",answerstring, work2)
  155.   iftrue goto no_memparam
  156.     ; we need it in 'bytes' for loadlin mem=
  157.   set work1 = ( answerstring * 1024 )
  158.   call sprintf(loadlin_mem_param, "mem=0x%lx\n", work1);
  159.  
  160. no_memparam:
  161.   call numbercmp(">=", answerstring, (6*1024) )
  162.   iffalse goto has_not_enough_mem
  163. #ifdef WE_HAVE_OLD_LOADLIN
  164.   ; now we check if we have enough mem for loadlin
  165.   ; (W'95 does steal the 0x90000 page for DRVSPACE)
  166.   ; NO: starting with LOALDIN-1.6 we don't have this problem
  167.   call checkloadlinmem(0)
  168.   iftrue
  169. #else
  170.   call
  171. #endif
  172.        return(1,nextjob,"ask_for_CD_or_HD")
  173.   show ( errfile_menu, tx_no9000page )
  174.   goto force_floppy
  175. has_not_enough_mem:
  176.   show ( errfile_menu, tx_check_if_GT_4Mb_err )
  177. force_floppy:
  178.   set bootmode = "2"
  179.   call strcpyitem(work1,bootmodes,bootmode)
  180.   printxy (main_log_colum,6,work1)
  181.   set nextjob = "write_floppies"
  182. }
  183.  
  184.  
  185. ;-----------------
  186. ask_for_CD_or_HD: function {
  187.  
  188.   set nextjob = "cancelinstall"
  189.   ; now we ask if the user has a Linux supported CD
  190.   set buttontextlist = distribmodetx
  191.   call choicepreset(SSdistribmode);
  192.   show ( big_empty_menu, tx_ask_for_CD_or_HD, button_ask )
  193.   call createvar(SSdistribmode,buttonresult)
  194.   set  distribmode = buttonresult
  195.   set  distrib_path = drive
  196.   call numbercmp("=",distribmode,2);
  197. ;  iffalse return(1,nextjob,"loadlin_or_floppy_menu")
  198.   iffalse return(1,nextjob,"loadlin_scroll")
  199.  
  200.   ; we must install from HD, ask for the path
  201.   oncemore: label
  202.   set answerstring = "C:\\tmp"
  203.   set answerstring = SSdistribHD
  204.   show (enter_string, tx_ask_for_CD_or_HD_2)
  205.   call translate(distribHDpath,answerstring,"\\/");
  206.   call sscanf(distribHDpath,"%*1s%1s%s",work1,loadlin_image_prefix);
  207.   call stringequal(work1,":")
  208.   iffalse goto oncemore
  209.   call createvar(SSdistribHD,distribHDpath)
  210.   set  distrib_path = distribHDpath
  211. ;  set nextjob = "loadlin_or_floppy_menu"
  212.   set nextjob = "loadlin_scroll"
  213. }
  214.  
  215.  
  216. ;-----------------
  217. loadlin_or_floppy_menu: function {
  218.   set buttontextlist = bootmodetx
  219.   call choicepreset(SSbootmode)
  220.   show ( big_empty_menu, tx_loadlin_or_floppy_menu , button_ask )
  221.   call createvar(SSbootmode,buttonresult)
  222.   set bootmode = buttonresult
  223.   call strcpyitem(work1,bootmodes,bootmode)
  224.   printxy (main_log_colum,6,work1)
  225.  
  226.   ; this sets the next job
  227.   call strcpyitem(nextjob,bootjobs,bootmode)
  228. }
  229.  
  230.  
  231. ;-----------------
  232.  
  233. ask_f_kernel: function {
  234.   set scroll_list = f_kernels
  235.   set scroll_step = "3"
  236.   call choicepreset(SSf_kernels);
  237.   show ( scroll_main_help_menu, f_kernels_help)
  238.   call createvar(SSf_kernels,scroll_result_item)
  239.   set chosenkernellist  = scroll_result
  240.   call strcpyitem(work1,chosenkernellist,1)
  241.   printxy (main_log_colum,7,work1)
  242.   call strcpyitem(chosenkernel,chosenkernellist,3)
  243.   call strcpyitem(work1,bootdirs,bootmode)
  244.   call sprintf(filestr,"%s%s/%s",distribCDpath,work1,chosenkernel)
  245. }
  246.  
  247. ask_f_root: function {
  248.   set scroll_list = f_roots
  249.   set scroll_step = "3"
  250.   call choicepreset(SSf_roots);
  251.   show ( scroll_main_help_menu, f_roots_help)
  252.   call createvar(SSf_roots,scroll_result_item)
  253.   call strcpyitem(rootdiskpath,scroll_result,3)
  254.   call strcpyitem(work1,bootdirs,bootmode)
  255.   call sprintf(filestr,"%s%s/%s", distribCDpath,work1,rootdiskpath)
  256. }
  257.  
  258. ask_f_install: function {
  259.   call strcpyitem(work1,bootdirs,bootmode)
  260.   call sprintf(filestr,"%s%s/%s", distribCDpath,work1,setupdiskpath)
  261. }
  262.  
  263. write_floppies: function {
  264.  
  265.   call strcpyitem(work1,bootdirs,bootmode)
  266.   call sprintf(disklist,"%s%s/%s\n%s%s/%s\n%s%s/%s\n",
  267.     distribCDpath,work1,chosenkernel,
  268.     distribCDpath,work1,rootdiskpath,
  269.     distribCDpath,work1,setupdiskpath,
  270.   )
  271.   ; we now ask for what disk to write
  272.   ; we do this in a loop, so the user has to cancel
  273. loop: label
  274.   set buttontextlist = tx_write_floppies_list
  275.   show ( big_empty_menu, tx_write_floppies, button_ask )
  276.   call numbercmp("=",buttonresult,3)
  277.   iffalse goto doit
  278.   call save_defaults()
  279.   call exit( tx_write_floppies_ex );
  280. doit: label
  281.   ; call strcpyitem(work2,"ask_f_kernel\nask_f_root\nask_f_install",buttonresult)
  282.   call strcpyitem(work2,"ask_f_kernel\nask_f_root",buttonresult)
  283.  
  284.   call work2()  ; this calls the chosen submenu
  285.  
  286.   set buttontextlist = tx_write_floppies_drive
  287.   call choicepreset(SSfloppy)
  288.   show ( big_empty_menu, tx_write_floppies_insert, button_ask )
  289.   call createvar(SSfloppy,buttonresult)
  290.   call strcpyitem(floppydrive,"A\nB",buttonresult)
  291.   show ( big_empty_menu,, do_rawrite )
  292.   goto loop
  293. }
  294.  
  295. do_rawrite: function {
  296.   call printf( tx_do_rawrite, filestr)
  297. #ifdef TESTING
  298.   set filestr = "setup.exe"
  299. #endif
  300.   call disk_rawrite (filestr, floppydrive)
  301.   iftrue goto ok
  302.   call printf(tx_do_rawrite_err)
  303.   ok: label
  304.   set buttontextlist = tx_continue
  305.   call button_ask()
  306. }
  307.  
  308.  
  309. ;-----------------
  310. loadlin_scroll: function {
  311.   ; check, if there is the $$CAM000 driver loaded
  312.   call driver_loaded("$$CAM000")
  313.   iftrue print_NCRwarning(0)
  314.  
  315.   set scroll_list = z_kernels
  316.   set scroll_step = "3"
  317.   call choicepreset(SSz_kernels);
  318.   show ( scroll_main_help_menu, z_kernels_help)
  319.   call createvar(SSz_kernels,scroll_result_item)
  320.   set chosenkernellist  = scroll_result
  321.   call strcpyitem(work1,chosenkernellist,1)
  322.   printxy (main_log_colum,7,work1)
  323.   call strcpyitem(chosenkernel,chosenkernellist,3)
  324.  
  325.   ; this sets where we contnue
  326.   ; call strcpyitem(nextjob,"loadlin_scroll_CD\nloadlin_scroll_HD",distribmode)
  327.   set nextjob = loadlin_scroll_successor
  328. }
  329.  
  330. ;-----------------
  331. print_NCRwarning: function {
  332.   show ( big_err_menu, tx_print_NCRwarning )
  333. }
  334.  
  335. ;-----------------
  336. loadlin_scroll_CD: function {
  337.   set scroll_list = CD_devices
  338.   set scroll_step = "2"
  339.   call choicepreset(SSCD_devices);
  340.   show ( scroll_main_help_menu, CD_devices_help)
  341.   call createvar(SSCD_devices,scroll_result_item)
  342.   call strcpyitem(chosenCDlist,CD_devices_params,scroll_result_item,2)
  343.   call strcpyitem(loadlin_rootimage_dev,chosenCDlist,1)
  344.   call strcpyitem(work1,chosenCDlist,2)
  345.   call translate(loadlin_default_CD_param,work1," \n");
  346.  
  347. #ifdef NOTHING
  348. call printf("loadlin_rootimage_dev =>%s<\nloadlin_default_CD_param = >%s<\n",
  349.   loadlin_rootimage_dev,
  350.   loadlin_default_CD_param
  351. )
  352. waitkey ()
  353. #endif
  354.  
  355.   ; this sets where we contnue
  356.   set nextjob = loadlin_scroll_successor
  357. }
  358.  
  359.  
  360. ;-----------------
  361. loadlin_scroll_HD: function {
  362.   set scroll_list = HD_devices
  363.   set scroll_step = "2"
  364.   call choicepreset(SSHD_devices);
  365.   show ( scroll_main_help_menu, HD_devices_help)
  366.   call createvar(SSHD_devices,scroll_result_item)
  367.   set chosenHDlist  = scroll_result
  368.   call strcpyitem(loadlin_rootimage_dev,chosenHDlist,1)
  369.   set  loadlin_default_CD_param = "onlycd=none"
  370.  
  371. #ifdef NOTHING
  372. call printf("loadlin_rootimage_dev =>%s<\nloadlin_default_CD_param = >%s<\n",
  373.   loadlin_rootimage_dev,
  374.   loadlin_default_CD_param
  375. )
  376. waitkey ()
  377. call exit("")
  378. #endif
  379.  
  380.   ; this sets where we contnue
  381.   set nextjob = loadlin_scroll_successor
  382. }
  383.  
  384. ;-----------------
  385. kdb_scroll: function {
  386.   set scroll_list = kdb_scroll_list
  387.   set scroll_step = "1"
  388.   call choicepreset(SSkdb);
  389.   call createvar(SSkdb,scroll_result_item)
  390.   show ( scroll2_main_help_menu, kdb_scroll_help)
  391.   set chosen_keymap  = scroll_result
  392.   call strprefix(chosen_keymap,"kbd=")
  393.  
  394. #ifdef NOTHING
  395. call printf("chosen_keymap =>%s<\n", chosen_keymap )
  396. waitkey ()
  397. call exit("")
  398. #endif
  399.  
  400.   ; this sets where we contnue
  401.   set nextjob = "get_kernel_params"
  402. }
  403.  
  404. ;-----------------
  405. get_kernel_params: function {
  406. ;  set nextjob = "start_loadlin"
  407.   set nextjob = "ask_create_loadlin_dir"
  408.   set answerstring = ""
  409.   set answerstring = SSkernelpar
  410.   call strcompress(answerstring) ; reduce all blanks to one
  411.  
  412.   show (enter_big_string, tx_get_kernel_params)
  413.   set kernel_params = answerstring
  414.   call translate(work1,kernel_params,"\n ");
  415.   call strcat(kernel_params," ");
  416.   call strcompress(kernel_params) ; reduce all blanks to one
  417.   call createvar(SSkernelpar,work1)
  418. }
  419.  
  420. ;-----------------
  421. ask_create_loadlin_dir: function {
  422.   set buttontextlist = tx_ask_create_loadlin_dir_NY
  423.   show ( big_empty_menu, tx_ask_create_loadlin_dir, button_ask )
  424.   call strcpyitem(nextjob,"start_loadlin\ncreate_loadlin_dir",buttonresult)
  425. }
  426.  
  427. loadlin_dos_path: string {"C:\\loadlin"}
  428.  
  429. ;-----------------
  430. create_loadlin_dir: function {
  431.   set nextjob = "start_loadlin"
  432.   call sprintf(work1,"md %s",loadlin_dos_path)
  433.   call system(work1)
  434.  
  435.   call strcpyitem(work1,bootdirs,bootmode)
  436.   call sprintf(work2,"copy %s%s/%s.ikr %s/zimage", drive, work1, chosenkernel, loadlin_dos_path)
  437.   call numbercmp("=",distribmode,2)
  438.   iftrue sprintf(work2,"copy %s%s/%s.ikr %s/zimage", distribHDpath,work1,chosenkernel, loadlin_dos_path)
  439.   call translate(work3,work2,"/\\");
  440.   call system(work3)
  441.  
  442.   call sprintf(work2,"copy %s%s/loadlin.exe %s",distrib_path,loadlin_exec_path, loadlin_dos_path);
  443.   call translate(work3,work2,"/\\");
  444.   call system(work3)
  445.  
  446.   call sprintf(work2,"%s\\linux.par", loadlin_dos_path)
  447.   call translate(work3,work2,"/\\");
  448.   call sprintf(work1,
  449.     "# params file for LOADLIN, generated for SuSE Linux\n\n"
  450.     "%s\\zimage  # file name of kernel image\n"
  451.     "root=/dev/xxx        # root file system, this will be overwritten\n"
  452.     "                     # by LINUX.BAT, when started with correct value\n"
  453.     "ro                   # root-fs will be mounted readonly\n"
  454.     "                     # (may be changed by LINUX.BAT)\n"
  455.     ,loadlin_dos_path
  456.   )
  457.   call strcat(work1,"\n\n# here may be your chosen keymap params\n")
  458.   call strcat(work1,chosen_keymap)
  459.   call strcat(work1,"\n\n# CD-dependent kernel_params\n")
  460.   call strcat(work1,loadlin_default_CD_param)
  461.   call strcat(work1,"\n\n# may be a mem= param follows\n")
  462.   call strcat(work1,loadlin_mem_param)
  463.   call strcat(work1,"\n# this is the language you selected\n")
  464.   call strcat(work1,loadlin_lang_param)
  465.   call strcat(work1,"\n# here follow some kernel params you entered during setup\n")
  466.   call strcat(work1,kernel_params)
  467.   call strcat(work1, "\n\n# end of params file\n")
  468.   call writetextfile(work3,work1)
  469.  
  470.  
  471.  
  472.   call sprintf(work2,"%s\\linux.bat", loadlin_dos_path)
  473.   call translate(work3,work2,"/\\");
  474.   set work1 =
  475.     "@echo off\n"
  476.     'if "%1\"=="" goto usage\n'
  477.     "goto goon\n"
  478.     ":usage\n"
  479.   call strcat(work1,tx_create_loadlin_dir)
  480.   call strcat(work1,
  481.     "goto ende\n"
  482.     ":goon\n"
  483.     "set RWRD=ro\n"
  484.     'if "%2\"=="" goto goon2\n'
  485.     "set RWRD=rw\n"
  486.     ":goon2\n"
  487.   )
  488.   call sprintf(work2,  "%s\\loadlin @%s\\linux.par", loadlin_dos_path, loadlin_dos_path)
  489.   call strcat(work1, work2)
  490.   call strcat(work1, " root=/dev/%1 %RWRD%\n:ende\n")
  491.   call writetextfile(work3,work1)
  492. }
  493.  
  494.  
  495. #ifdef NOTHING              ; this for later usage
  496. DOShistory: string { "" }
  497.  
  498. exec_DOScomand: menu (6,10, 80-2*6, 25-2*10,0,1) {
  499.   image {
  500.     "Geben Sie den DOS-Befehl ein, den Sie ausfuehren moechten"
  501.   }
  502.   action {
  503.     set answerstring = ""
  504.     call enterstring (answerstring, 1,DOShistory)
  505.     ;                 ^----to this inputted (or modified) result is copied
  506.     ;                      (at input the contents of resultstring are
  507.     ;                       offered to user to be modified )
  508.     iffalse exit(cancelmesg)  ; exits if an empty string was entered
  509.     call sprintf(DOShistory,"%s\n%s",DOShistory,answerstring);
  510.     call system(answerstring)
  511.   }
  512. }
  513. #endif
  514.  
  515.  
  516. start_loadlin: function {
  517.   call strcpyitem(work1,bootdirs,bootmode)
  518.   call sprintf(loadlin_zimage,"%s%s/%s", drive, work1, chosenkernel)
  519.   call sprintf(loadlin_initrd,"initrd=%s%s/initdisk.gz", drive, work1);
  520.   call numbercmp("=",distribmode,2)
  521.   iffalse goto ok
  522.   call sprintf(loadlin_zimage,"%s%s/%s",distribHDpath,work1,chosenkernel)
  523.   call sprintf(loadlin_initrd,"initrd=%s%s/initdisk.gz",distribHDpath, work1);
  524. ok: label
  525.   set work1 = loadlin_rootimage_dev
  526.   call sprintf(loadlin_rootimage_dev,
  527.     "rootimage=/dev/%s:%s/suse/images/root",
  528.     work1,loadlin_image_prefix
  529.   );
  530.   call strprefix(kernel_params,loadlin_mem_param);
  531.   call strprefix(kernel_params,"\n");
  532.   call strprefix(kernel_params,loadlin_default_CD_param);
  533.   call strcat(kernel_params,loadlin_lang_param);
  534.  
  535. #ifdef LOADLIN_EXE_TEST
  536.   set work1 = ""
  537. #else
  538.   call sprintf(work1,"%s%s",distrib_path,loadlin_exec_path);
  539. #endif
  540.   call save_defaults()
  541.   call translate(work2,kernel_params,"\n ");
  542.   call sprintf(work4,
  543.     "%s root=200 ramdisk_size=10240 rw 2 %s"
  544.     #ifdef DO_KBD_REQUEST
  545.     " %s"
  546.     #endif
  547.     " %s",
  548.     loadlin_zimage,
  549.     loadlin_initrd,
  550. ;    loadlin_rootimage_dev,
  551.     #ifdef DO_KBD_REQUEST
  552.       chosen_keymap,
  553.     #endif
  554.     work2
  555.   );
  556.   call sprintf(work2, "%s\nLOADLIN %s",tx_start_loadlin,work4)
  557. #ifdef LOADLIN_TEST
  558.   set buttontextlist = "Load Linux\nRun Loadlin -t"
  559. #else
  560.   set buttontextlist = tx_start_loadlin_list
  561. #endif
  562.   show ( real_big_empty_menu, work2, button_ask )
  563.   set work3 = " -v\n -t"
  564.   call existfile("c:/loadlin/susesave.mnu")
  565.   iftrue sprintf(work3," -v\n -d c:/loadlin/susesave.dbg")
  566.   call strcpyitem(work2, work3 ,buttonresult)
  567.   call strcat(work4,work2)
  568.   #ifdef FINAL_TEST
  569.     call printf("%s\n%s",work1,work4)
  570.     waitkey ()
  571.   #else
  572.     call exec_loadlin(work1,work4);
  573.   #endif
  574.   call exit(tx_start_loadlin_err)
  575. }
  576.  
  577. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  578. ;@@@@@@@@@@@@@@@@@@@@@  JOB-SPECIAL MENUS  @@@@@@@@@@@@@@@@@@@@@@@@@@
  579. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  580.  
  581. ;===========================================================================
  582. ; This are the Skroll menu's triple
  583.  
  584. scroll_main_help_menu: menu (40,7, 80-40-3, 25-8-6,0) {
  585.   image { "" }
  586.   action {
  587.     show ( scroll_help_menu )
  588.   }
  589. }
  590. scroll_help_menu: menu (0,25-7, 80, 7, 1) {
  591.   image { "" }
  592.   action {
  593.     show ( scroll_window )
  594.   }
  595. }
  596. scroll_window: menu (3,7, 35,11, 0) {
  597.   image { "" }
  598.   action {
  599.     ;         string-array[n][step]---v                         v--- menu for scroll-helps
  600.     call scrollbar (scroll_result, scroll_list, scroll_step, scroll_help_menu)
  601.     ;               ^----here the resulting array-item is copied
  602.     iffalse cancelinstall(0)
  603.     set  scroll_result_item = __lastresult__
  604.   }
  605. }
  606.  
  607.  
  608. ; This are the Skroll menu's pairs
  609.  
  610. scroll2_main_help_menu: menu (40,7, 80-40-3, 25-8,0) {
  611.   image { "" }
  612.   action {
  613.     show ( scroll2_window )
  614.   }
  615. }
  616. scroll2_window: menu (3,7, 35,25-8, 0) {
  617.   image { "" }
  618.   action {
  619.     ;         string-array[n][step]---v
  620.     call scrollbar (scroll_result, scroll_list, scroll_step)
  621.     ;               ^----here the resulting array-item is copied
  622.     iffalse cancelinstall(0)
  623.     set  scroll_result_item = __lastresult__
  624.   }
  625. }
  626.  
  627.  
  628.  
  629. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  630. ;@@@@@@@@@@@@@@@@@@@@@  AUXILIARY FUNCTIONS  @@@@@@@@@@@@@@@@@@@@@@@@
  631. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  632.  
  633. ;-----------------
  634. save_defaults: function {
  635.   call createvar(work1_,"")
  636.   set work1_ = SSversion
  637.   ifnoterror goto do_save_defaults
  638.   set buttontextlist = tx_save_defaults_YN
  639.   show (small_empty_menu, tx_save_defaults, button_ask_nocancel)
  640.   call numbercmp("=",buttonresult,1)
  641.   iffalse goto no_save_defaults
  642.   call createvar(SSversion,ourSSversion)
  643. do_save_defaults:
  644.   call mkdir("C:/loadlin")
  645.   call savevars("C:/loadlin/susesave.mnu",
  646.     SSversion,
  647.     SSdrive,SSmem,
  648.     SSz_kernels,SSf_kernels,SSf_roots,
  649.     SSHD_devices,SSCD_devices,
  650.     SSdistribHD,SSkdb,
  651.     SSdistribmode,SSbootmode,SSfloppy,
  652.     SSkernelpar
  653.   )
  654. no_save_defaults: label
  655. }
  656.  
  657. ;-----------------
  658. cancelinstall: function {
  659.  
  660. #ifdef TESTING
  661.   show (debug_stop,nextjob)
  662. #endif
  663.   call save_defaults()
  664.   call exit(cancelmesg)
  665. }
  666.  
  667.  
  668. ;-----------------
  669. quitinstall: function {
  670.  
  671. #ifdef TESTING
  672.   show (debug_stop,nextjob)
  673. #endif
  674.   call save_defaults()
  675.   call exit(quitmesg)
  676. }
  677.  
  678. ;-----------------
  679. button_ask: function {
  680.   ; uses the string buttontextlist as input
  681.   ; and returns the selected item number in buttonresult
  682.   call buttons(buttontextlist)
  683.   iffalse cancelinstall(0)
  684.   set  buttonresult = __lastresult__
  685. }
  686.  
  687. ;-----------------
  688. button_ask_nocancel: function {
  689.   ; uses the string buttontextlist as input
  690.   ; and returns the selected item number in buttonresult
  691.  
  692.   set  buttonresult = "0"
  693.   call buttons(buttontextlist)
  694.   iffalse return(0)
  695.   set  buttonresult = __lastresult__
  696. }
  697.  
  698. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  699. ;@@@@@@@@@@@@@@@@@@@@@@@  AUXILIARY  MENUS @@@@@@@@@@@@@@@@@@@@@@@@@@
  700. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  701.  
  702. big_empty_menu: menu (6,3,80-2*6,25-2*3+2,0) {
  703.   image { "" }
  704. }
  705.  
  706. real_big_empty_menu: menu (0,2,80,25-2*2+2,0) {
  707.   image { "" }
  708. }
  709.  
  710. small_empty_menu: menu (15,7,80-2*15,25-7-5,0) {
  711.   image { "" }
  712. }
  713.  
  714.  
  715. enter_char: menu (20,8,80-2*20,25-8-6,0) {
  716.   image { "" }
  717.   action {
  718. #ifdef NOTHING
  719.     call getkey(answerstring,"abcdefghijklmnopqrstuvwxyz\r",1)
  720. #else
  721.     call enterstring (answerstring, 1);
  722.     iffalse cancelinstall(0)  ; exits if an empty string was entered
  723.     call sprintf(work1,"%c",answerstring);
  724.     set answerstring = work1;
  725. #endif
  726.   }
  727. }
  728.  
  729. enter_string: menu (6,7, 80-2*6, 25-2*7,0) {
  730.   image querystring
  731.   action {
  732.     ;    number of lines on bottom--v
  733.     call enterstring (answerstring, 1)
  734.     ;                 ^----to this inputted (or modified) result is copied
  735.     ;                      (at input the contents of resultstring are
  736.     ;                       offered to user to be modified )
  737.     iffalse cancelinstall(0)  ; exits if an empty string was entered
  738.   }
  739. }
  740.  
  741. enter_big_string: menu (6,7, 80-2*6, 25-7,0) {
  742.   image querystring
  743.   action {
  744.     ;    number of lines on bottom--v
  745.     call enterstring (answerstring, 5)
  746.     ;                 ^----to this inputted (or modified) result is copied
  747.     ;                      (at input the contents of resultstring are
  748.     ;                       offered to user to be modified )
  749.   }
  750. }
  751.  
  752. showfile_menu: menu (6,3,80-2*6,25-2*2,0) {
  753.   image { "" }
  754.   action {
  755.     call showfile(filestr)
  756.     iftrue goto ok
  757.     call sprintf(errorstring, tx_showfile_menu, filestr);
  758.     show ( errfile_menu, errorstring )
  759.     call return(0)
  760.   ok: label
  761.     call buttons(tx_continue)
  762.     iffalse cancelinstall(0)
  763.   }
  764. }
  765.  
  766. errfile_menu: menu (15,7,80-2*15,25-7-5,0) {
  767.   image { "" }
  768.   action {
  769.     call buttons(tx_continue)
  770.     iffalse cancelinstall(0)
  771.   }
  772. }
  773.  
  774. big_err_menu: menu (8,6,80-2*8,25-6-3,0) {
  775.   image { "" }
  776.   action {
  777.     call buttons(tx_continue)
  778.     iffalse cancelinstall(0)
  779.   }
  780. }
  781.  
  782. debug_stop: menu (0,0, 80,3,5,0x6f,0x7f) {
  783.   image { "" }
  784.   action {
  785.     printxy(4,0,"Debug-window, press any key to continue",0x6f);
  786.     waitkey()
  787.   }
  788. }
  789.  
  790. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  791. ;@@@@@@@@@@@@@@@@@@@@@@@@@  DATA PART  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  792. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  793.  
  794. ; here we read in saved user input, it gets only included, when
  795. ; the setup wrapper (setup.mnu) sets -DSUSE_SAVE. And this is only
  796. ; done if the file susesave.mnu exists.
  797. #ifdef SUSE_SAVE
  798.   #include "c:/loadlin/susesave.mnu"
  799. #endif
  800.  
  801. ; some global strings
  802.  
  803. drive:            string    ; this will be asked from user
  804. distribution:     string { "SuSE Linux 6.1" }
  805.  
  806. #ifdef TESTING
  807.   distribCDpath:        string { "/suse/setup" } ;here: my private test directory
  808. #else
  809.   distribCDpath:        string { "" } ; root of CD1 e.g: E:/
  810. #endif
  811.  
  812. rootdiskpath:     string {"root"}
  813. setupdiskpath:    string {"pcmcia2"}
  814.  
  815. chosenkernel:     string   ; base name of the chosen kernel/disk
  816. chosenkernellist: string   ; stringlist of the chosen kernel/disk
  817. disklist:         string
  818.  
  819. distribmode:      string {"1"}
  820. distribHDpath:    string { "" }
  821. distrib_path:     string
  822.  
  823. chosenCDlist:           string
  824. chosenHDlist:           string
  825. loadlin_exec_path:      string {"/suse/setup"}
  826. loadlin_zimage:         string
  827. loadlin_root_dev:       string
  828. loadlin_image_prefix:   string
  829. loadlin_initrd:         string
  830. loadlin_rootimage_dev:  string
  831. loadlin_default_CD_param: string
  832. loadlin_mem_param:      string
  833. kernel_params:          string
  834. tx_no9000page:          string
  835.  
  836.  
  837. ; bootmode definitions
  838. bootmode:      string {"2"}
  839. bootmodetx:    string {"Loadlin\nFloppy"}
  840.  
  841. bootjobs:        string {
  842. ;  "loadlin_scroll\n"
  843.   "check_if_GT_4Mb\n"
  844.   "write_floppies"
  845. }
  846.  
  847. bootmenus:        string {
  848.   "z_kernels_main_help\n"
  849.   "f_kernels_main_help"
  850. }
  851.  
  852. bootdirs:        string {
  853.   "/suse/images\n"
  854.   "/disks"
  855. }
  856.  
  857. floppydrive:       string
  858.  
  859. chosen_keymap:   string
  860. kdb_scroll_list: string {
  861.   "azerty\nbe-latin1\ncf\nde-latin1-nodeadkeys\n"
  862.   "de-latin1\nde\ndefkeymap\ndefkeymap_V1.0\ndk-latin1\n"
  863.   "dk\ndvorak\nemacs\nemacs2\nes\nfi-latin1\nfi\n"
  864.   "fr-latin1\nfr\ngr-pc\ngr\nhebrew\nit-ibm\nit\n"
  865.   "no-latin1\nno\npl\nru\nru1\nru2\nsf-latin1\nsf\n"
  866.   "sg-latin1-lk450\nsg-latin1\nsg\nslovene\nuk\nus\n"
  867. }
  868.  
  869. #ifdef DO_KBD_REQUEST
  870.   loadlin_scroll_successor: string { "kdb_scroll" }
  871. #else
  872.   loadlin_scroll_successor: string { "get_kernel_params" }
  873. #endif
  874.  
  875. ;----------here are the language independent parts of configuration
  876.  
  877. CD_devices_params:  string {
  878.   ; string list, step-width = 3, means: each 3rd line is a new item
  879.   ; NOTE: If you changes this, you also have to update
  880.   ;       'CD_devices' in the language dependent parts (setupger, setupeng)
  881.  
  882.   ;---
  883.   ; *** 1. SCSI CD-ROM
  884.   "scd0\n"
  885.   "onlycd=none\n"
  886.  
  887.   ; *** 2. SCSI CD-ROM
  888.   "scd1\n"
  889.   "onlycd=none\n"
  890.  
  891.   ; *** ATAPI IDE ->hda
  892.   "hda\n"
  893.   "hda=cdrom onlycd=none\n"
  894.  
  895.   ; *** ATAPI IDE ->hdb
  896.   "hdb\n"
  897.   "hdb=cdrom onlycd=none\n"
  898.  
  899.   ; *** ATAPI IDE ->hdc
  900.   "hdc\n"
  901.   "hdc=cdrom onlycd=none\n"
  902.  
  903.   ; *** ATAPI IDE ->hdd
  904.   "hdd\n"
  905.   "hdd=cdrom onlycd=none\n"
  906.  
  907.   ; *** ATAPI IDE ->hde
  908.   "hde\n"
  909.   "hde=cdrom onlycd=none\n"
  910.  
  911.   ; *** ATAPI IDE ->hdf
  912.   "hdf\n"
  913.   "hdf=cdrom onlycd=none\n"
  914.  
  915.   ; *** ATAPI IDE ->hdg
  916.   "hdg\n"
  917.   "hdg=cdrom onlycd=none\n"
  918.  
  919.   ; *** ATAPI IDE ->hdh
  920.   "hdh\n"
  921.   "hdh=cdrom onlycd=none\n"
  922.  
  923.   ; *** Aztech
  924.   "aztcd\n"
  925.   "onlycd=aztcd\n"
  926.  
  927.   ; *** Goldstar
  928.   "gscd0\n"
  929.   "onlycd=gscd\n"
  930.  
  931.   ; *** Mitsumi
  932.   "mcd\n"
  933.   "onlycd=mcd\n"
  934.  
  935.   ; *** Mitsumi
  936.   "mcdx0\n"
  937.   "onlycd=mcdx\n"
  938.  
  939.   ; *** Philips
  940.   "cm206cd\n"
  941.   "onlycd=cm206\n"
  942.  
  943.   ; *** Sony CDU 31A/33A
  944.   "sonycd\n"
  945.   "onlycd=cdu31a\n"
  946.  
  947.   ; *** Sony CDU 535/531
  948.   "cdu535\n"
  949.   "onlycd=sonycd535\n"
  950.  
  951.   ; *** Soundblaster
  952.   "sbpcd\n"
  953.   "onlycd=sbpcd\n"
  954.  
  955.   ; *** Optics Storage 8000 AT CDROM (an ISP16 oder Panasonic CDROM interface)
  956.   "optcd0\n"
  957.   "onlycd=optcd\n"
  958.  
  959.   ; *** SANYO CDR-H94A (an ISP16 oder Panasonic CDROM interface)
  960.   "sjcd\n"
  961.   "onlycd=sjcd\n"
  962.  
  963.   ; *** ISP16 (Mozart)
  964.   "isp16\n"
  965.   "onlycd=isp16\n"
  966.  
  967.   ; *** BPCD (Parallel Port CD-ROM)
  968.   "bpcd\n"
  969.   "onlycd=bpcd\n"
  970.  
  971.   ; *** PWCD (Parallel Port CD-ROM)
  972.   "pwcd\n"
  973.   "onlycd=pwcd\n"
  974.  
  975. }
  976.  
  977.  
  978.  
  979. ;----------here are the language dependent parts included
  980. ;
  981. #ifdef GERMAN
  982.     #include "setupger.mnu"
  983. #else
  984. #ifdef ENGLISH
  985.     #include "setupeng.mnu"
  986. #else
  987. #ifdef SPANISH
  988.     #include "setupesp.mnu"
  989. #else
  990. #ifdef FRENCH
  991.     #include "setupfr.mnu"
  992. #else
  993. #ifdef INDONESIA
  994.     #include "setupidn.mnu"
  995. #else
  996. #ifdef ITALIAN
  997.     #include "setupita.mnu"
  998. #else
  999. #ifdef HUNGARIA
  1000.     #include "setuphun.mnu"
  1001. #else
  1002. #ifdef DUTCH
  1003.     #include "setupnld.mnu"
  1004. #else
  1005. #ifdef POLISH
  1006.     #include "setuppol.mnu"
  1007. #else
  1008. #ifdef PORTUGUESE
  1009.     #include "setupprt.mnu"
  1010. #else
  1011. #ifdef BRAZIL
  1012.     #include "setupbra.mnu"
  1013. #else
  1014. #ifdef RUSSIA
  1015.     #include "setuprus.mnu"
  1016. #else
  1017.     should_not_come: here
  1018. #endif
  1019. #endif
  1020. #endif
  1021. #endif
  1022. #endif
  1023. #endif
  1024. #endif
  1025. #endif
  1026. #endif
  1027. #endif
  1028. #endif
  1029. #endif
  1030.  
  1031. ;----------some most frequently used variables;
  1032. ;          put them at the end, so they are on top of the list
  1033.  
  1034. ; some work string definitions
  1035. work1:            string
  1036. work2:            string
  1037. work3:            string
  1038. work4:            string
  1039. querystring:      string
  1040. errorstring:      string
  1041. answerstring:     string
  1042. filestr:          string
  1043. result_list:      string
  1044.  
  1045.  
  1046. ; params for scroll menues:
  1047. ; input:
  1048. scroll_list:        string  ; the stringlist
  1049. scroll_step:        string  ; the step of the list
  1050. ; results:
  1051. scroll_result:      string  ; here the chosen string item is stored
  1052. scroll_result_item: string  ; here the chosen item (a number) is stored
  1053.  
  1054. ; params for button menues:
  1055. buttontextlist:   string
  1056. buttonresult:     string
  1057.  
  1058.  
  1059.  
  1060.  
  1061. nextjob:          string { "cancelinstall" }
  1062.  
  1063.