home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 March / VPR9703A.ISO / OLS / Os2 / PMREN12 / PMREN12.LZH / inst.cmd next >
OS/2 REXX Batch file  |  1996-07-09  |  3KB  |  129 lines

  1. /*****************************************************************
  2. *  PMレンジ Ver1.2 インストール 
  3. *                         Copyright(c) by M.Nakagawa(RZ)
  4. *                                           Nifty ID:LDL04621
  5. ******************************************************************/
  6. Options ETMODE
  7. Options EXMODE
  8.  
  9. if RxFuncQuery("SysLoadFuncs")then do
  10.       call RxFuncAdd"SysLoadFuncs","RexxUtil","SysLoadFuncs"
  11.       call SysLoadFuncs
  12. end
  13. /********* 前処理 ***********/
  14. /*BootDrive Get*/
  15. bootdrv = left(value("SYSTEM_INI",,"OS2ENVIRONMENT"),3)
  16. path = Directory()
  17.  
  18. inifile = bootdrv || "OS2\PMRENGE.INI"
  19. call SysFileDelete inifile
  20.  
  21.  
  22.  
  23. PATHA = bootdrv||"解凍庫"
  24. PATHB = bootdrv||"圧縮庫"
  25.  
  26. DLLPath = bootdrv||"os2\dll"
  27.  
  28.  
  29.  
  30. /********* 本処理 ***********/
  31. say "PMレンジ Ver 1.2 インストール"
  32. say "      by RZ (M.Nakagawa) 1996.7.8"
  33. say
  34. call prc3
  35.  
  36. call prc1
  37. call prc2
  38.  
  39. copy "mybmp.dll  "DLLPath
  40.  
  41.  
  42.  
  43. /* オブジェクト作成 */
  44.  
  45. FileName = path||"\PMRENGE.EXE"
  46. ObjTitle = "PMレンジ"
  47. Str1 = "EXENAME="||FileName";"
  48. SetUpStr =Str1|| "PROGTYPE=PM;ASSOCFILTER=*.LZH,*.ZIP;OBJECTID=<MASA001>;"
  49. ico_path = path||"\RENGE.ICO"
  50. if SysSetIcon(FileName,ico_path) then do
  51.    if SysCreateObject("WPProgram",ObjTitle,"<WP_DESKTOP>",SetUpStr,"U") Then Do
  52.       say "おめでとうございます。インストールが完了しました。"
  53.       say "感想など教えてもらえたらうれしいな!(^_-)"
  54.       call SysSleep 1
  55.    End
  56.    Else Do
  57.       say "残念ですがインストールに失敗しました" 
  58.       say "作者(LDL04621)に抗議しましょう^^; "
  59.    End
  60. end
  61.  
  62. exit
  63.  
  64.  
  65.  
  66. /*******************************************************************
  67.    関 数 部
  68. ********************************************************************/
  69.  
  70. prc1:procedure expose PATHA inifile
  71.  
  72.    say "解凍作業用ディレクトリを作成します。"
  73.    say "デフォルト--> " PATHA
  74.    say "ディレクトリを変更しますか?(Y/N)"
  75.    parse upper pull A
  76.    if A="Y" Then Do
  77.       say "解凍作業用ディレクトリをフルパスで指定して下さい"
  78.       parse upper pull PATHA
  79.    End
  80.  
  81.    call SysRmDir PATHA    
  82.    if SysMkdir(PATHA)=0  Then Do
  83.       call SysCreateShadow PATHA,"<WP_DESKTOP>"
  84.       say "解凍用作業ディレクトリを作成しました"
  85.       say
  86.    End
  87.    call LineOut inifile,"解凍先 " PATHA
  88.    call LineOut inifile
  89.  
  90.    return 1
  91.  
  92. prc2:procedure expose PATHB inifile
  93.  
  94.    say "圧縮作業用ディレクトリを作成します。"
  95.    say "デフォルト--> " PATHB 
  96.    say "ディレクトリを変更しますか?(Y/N)"
  97.    parse upper pull A
  98.    if A="Y" Then Do
  99.       say "圧縮作業用ディレクトリをフルパスで指定して下さい"
  100.       parse upper pull PATHB
  101.    End
  102.  
  103.    call SysRmDir PATHB    
  104.    if SysMkDir(PATHB)=0 Then Do
  105.       call SysCreateShadow PATHB,"<WP_DESKTOP>"
  106.       say "圧縮用作業ディレクトリを作成しました"
  107.       say
  108.    End
  109.    call LineOut inifile,"圧縮先 " PATHB
  110.    call LineOut inifile
  111.  
  112.    return 1
  113.  
  114.  
  115. prc3:procedure
  116.    say "旧バージョン(Ver1.1)がインストールされている場合、旧オブジェクトを削除します。"
  117.    say "インストールを実行しますか(Y/N)"
  118.    parse upper pull A
  119.    if A  <> "Y" Then Do
  120.       say "インストールを中断します"
  121.       say "次は入れてね (^_-)"
  122.       exit
  123.    End
  124.    say
  125.    call SysDestroyObject "<WP_ADD>"
  126.    call SysDestroyObject "<WP_EXT>"
  127.    call SysDestroyObject "<MASA001>"
  128.  
  129.    return 1