
(setq capcad_path (vl-registry-read "HKEY_CURRENT_USER" "CAPCAD_PATH" ))

(setq capcad_path (vl-string-trim " \t\n" capcad_path))



(defun CheckAddTrustedPath ( newPath / )
	(if (and (setq trusted (getvar 'trustedpaths))
		(not (vl-string-search newPath trusted))
		)
		(setvar 'trustedpaths
		(strcat (vl-string-right-trim ";" trusted) ";" newPath)
		)
	)
)



(CheckAddTrustedPath (strcat capcad_path "..."))

(command "_.menuunload" "CAPROADS"); l
(command "_.menuunload" "CAPCAD"); 
(command "_.menuunload" "CAPCAD-UK");  
(command "_.menuunload" "CAPCAD-EN");  
(command "_.menuunload" "CAPCAD-BR");  



(if (findfile (strcat capcad_path "capcad-br.cui"))
(progn 
	(command "_.menuload" (strcat capcad_path "capcad-br.cui"))
);progn
;else
	(alert "arquivo capcad-br.cui nao encontrado - rever instalacao")
)

(if (findfile (strcat capcad_path "CAPCAD_INI.dvb"))
(progn 
	(vl-vbaload (strcat capcad_path "CAPCAD_INI.dvb") )
	(command "_.vbarun" "LoadAll")
);progn
;else
	(alert "arquivo CAPCAD_INI.dvb nao encontrado - rever instalacao")
)


(command "_.RIBBON")
