9701519 发表于 2012-3-23 21:33:57

用秋枫老大程序制作的安装程序,问题出在哪里?

本帖最后由 9701519 于 2012-4-3 00:35 编辑

;;; 判断是否加载本文件
(if (car (atoms-family 1 '("vl-load-com")))
   (vl-load-com)
   ;;else
   (progn
       (Alert
         "这个程序集是为AutoCAD 2000以及更高的版本设计的,许多程序有可能在没有Visual Lisp for R14支持的AutoCAD R14上不能正确地运行。"
       )
       (exit) ; 版本不符,退出加载。
   )
)
;;; 以下定义文件中用到的函数
;;;----------------------------------------------------------------------------------;;; 取得本程序的路径
;;; ---------------------------------------------------------------------------------
(defun GetMyApplicationPath (AppID)
   (vl-registry-read
       (strcat
         "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\"
         AppID
         "_is1"
       )
       "Inno Setup: App Path"
   )
)(defun GetLZToolsPath ()
   (GetMyApplicationPath "Leon's Tools")
);;; 解析字符串为表(函数来自明经通道转载)
;;; ---------------------------------------------------------------------------------
(defun strParse (Str Delimiter / SearchStr StringLen return n char)
   (setq SearchStr Str)
   (setq StringLen (strlen SearchStr))
   (setq return '())
   (while (> StringLen 0)
       (setq n 1)
       (setq char (substr SearchStr 1 1))
       (while (and (/= char Delimiter) (/= char ""))
         (setq n (1+ n))
         (setq char (substr SearchStr n 1))
       ) ;_ end of while
       (setq return (cons (substr SearchStr 1 (1- n)) return))
       (setq SearchStr (substr SearchStr (1+ n) StringLen))
       (setq StringLen (strlen SearchStr))
   ) ;_ end of while
   (reverse return)
) ;_ end of defun;;; 反解析表为字符串(函数来自明经通道转载)
;;; ---------------------------------------------------------------------------------
(defun StrUnParse (Lst Delimiter / return)
   (setq return "")
   (foreach str Lst
       (setq return (strcat return Delimiter str))
   ) ;_ end of foreach
   (substr return 2)
) ;_ end of defun;;; 移除支持文件搜索路径
;;; ---------------------------------------------------------------------------------
(defun LZ_RemoveSupportPath (PathToRemove / supportlist)
   (setq supportlist (strparse (getenv "ACAD") ";"))
   (setq supportlist (vl-remove "" supportlist))
   (setq supportlist
               (vl-remove-if
                     '(lambda (x) (= (strcase x) (strcase PathToRemove)))
                     supportlist
               )
   )
   (setenv "ACAD" (strUnParse supportlist ";"))
);;; 添加支持文件搜索路径
;;; ---------------------------------------------------------------------------------
;;; note:   第二个参数如果为真, 插最前,否则插最后
;;;               
(defun LZ_AddSupportPath (PathToAdd isFirst / supportlist)
   (LZ_RemoveSupportPath PathToAdd)
   (setq supportlist (strparse (getenv "ACAD") ";"))
   (setq supportlist (vl-remove "" supportlist))
   (if isFirst
       (setq supportlist (cons PathToAdd supportlist))
       (setq supportlist (append supportlist (list PathToAdd)))
   )
   (setenv "ACAD" (strUnParse supportlist ";"))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun Init_LZools ()
    ;; 添加支持路径
   (LZ_AddSupportPath (GetLZToolsPath) nil)
   (LZ_AddSupportPath (strcat (GetLZToolsPath) "\\LISP") nil) (princ))
   





用此命令 (LZ_AddSupportPath (GetLZToolsPath) nil) 可以导入安装路径添加到CAD支持文件搜索路径,但命令行会出现如附件图片显示

写成以下这样就不能导入安装路径添加到CAD支持文件搜索路径
(defun Init_LZools ()
    ;; 添加支持路径
   (LZ_AddSupportPath (GetLZToolsPath) nil)
   (LZ_AddSupportPath (strcat (GetLZToolsPath) "\\LISP") nil) (princ))

byghbcx 发表于 2018-10-1 17:52:43

vl-registry-read,在64位win7系统中读不出,有什么解决办法?

9701519 发表于 2012-3-23 23:05:35

用秋枫老大程序制作的安装程序,问题出在哪里?

本帖最后由 9701519 于 2012-4-3 00:17 编辑

用秋枫老大程序制作的安装程序,问题出在哪里?

9701519 发表于 2012-3-24 21:27:03

本帖最后由 9701519 于 2012-4-3 00:18 编辑

用秋枫老大程序制作的安装程序,问题出在哪里?

soly2006 发表于 2012-3-24 23:47:29

不顶不行,不要让他给沉了!
楼下继续。

shenyanggang 发表于 2012-3-25 08:45:24

请高手出来帮忙啊!

9701519 发表于 2012-3-25 21:34:45

本帖最后由 9701519 于 2012-4-3 00:18 编辑

用秋枫老大程序制作的安装程序,问题出在哪里?

9701519 发表于 2012-4-2 01:41:45

本帖最后由 9701519 于 2012-4-3 00:18 编辑

问题出在哪里?

9701519 发表于 2012-4-3 00:20:22

9701519 发表于 2012-4-3 11:52:50

没人知道吗?

革天明 发表于 2012-9-15 15:04:25

9701519 发表于 2012-4-3 11:52 static/image/common/back.gif
没人知道吗?

我的就没有出过问题,直接用2011-4-20的那个程序
页: [1] 2
查看完整版本: 用秋枫老大程序制作的安装程序,问题出在哪里?