Appdata bundle folder location in Windows XP 2012/2014/2015

Appdata bundle folder location in Windows XP 2012/2014/2015

Ajilal.Vijayan
Advisor Advisor
1,918 Views
14 Replies
Message 1 of 15

Appdata bundle folder location in Windows XP 2012/2014/2015

Ajilal.Vijayan
Advisor
Advisor

Hi all,

 

I have this code to locate the Appdata bundle folder location in Windows 7 & 8 for Acad 2012/2014/2015

(setq path (strcat (substr (getvar "ROAMABLEROOTPREFIX") 1( + 8(vl-string-search "Autodesk"(getvar "ROAMABLEROOTPREFIX")))) "\\ApplicationPlugins\\"))

 Before this code I was using below code to locate the bundle folder, but it fails in windows XP.

(setq path (strcat "C:\\Users\\"(getvar "LOGINNAME")"\\AppData\\Roaming\\Autodesk\\ApplicationPlugins\\"))

 

I dont have AutoCAD running on windows XP to check.

If you have AutoCAD 2012 or later version running on Windows XP, can you please check the first code, whether it returns the actual path ?

 

Also I like to hear any improvements on this code which should work in Windows XP, 7 & 8.

 

Thanks.

Ajilal.

 

0 Likes
Accepted solutions (1)
1,919 Views
14 Replies
Replies (14)
Message 2 of 15

hmsilva
Mentor
Mentor

Hi Ajilal,

 

I don't have XP to test...

 

(setq path (strcat "C:\\Documents and Settings\\" (getvar "LOGINNAME")"\\Application Data\\Roaming\\Autodesk\\ApplicationPlugins\\"))

 

Henrique

EESignature

0 Likes
Message 3 of 15

Ajilal.Vijayan
Advisor
Advisor

Hi Henrique,

 

Thanks for the  reply.

But the code which you mentioned will only work with XP, as in Windows 7 & 8 the appdata folder is in C:\Users\....

I would like to have a code that will work in XP, 7 & 8.

 

This code seems to be working with all windows.

But I need to check this code with XP.

 

(defun plugin ()
(vl-load-com)
(setq path (strcat (substr (getvar "ROAMABLEROOTPREFIX") 1( + 8(vl-string-search "Autodesk"(getvar "ROAMABLEROOTPREFIX")))) "\\ApplicationPlugins\\"))
(if (vl-file-directory-p path) (print "Plugins folder found") (print "Plugins folder NOT found") );if );defun (plugin)

 

 

 

0 Likes
Message 4 of 15

hmsilva
Mentor
Mentor
Unfortunately I don't have XP in any box...

Henrique

EESignature

0 Likes
Message 5 of 15

marko_ribar
Advisor
Advisor
(defun plugin ()

;(setq path (strcat (substr (getvar "ROAMABLEROOTPREFIX") 1 (+ 8 (vl-string-search "Autodesk" (getvar "ROAMABLEROOTPREFIX")))) "\\ApplicationPlugins\\")) ;;; This doesn't work always - on XP doesn't work and on 32 bit AutoCAD software

(setq path (strcat (substr (getvar "ROAMABLEROOTPREFIX") 1 (+ 8 (vl-string-search "Autodesk" (getvar "ROAMABLEROOTPREFIX")))) "\\")) ;;; This works

(if (vl-file-directory-p path)
(print "Folder found")
(print "Folder NOT found")
);if
);defun
(plugin)

 
;; Windows XP Service Pack 3 - my main PC with emulation of XP 32 bit system
;; (getvar "ROAMABLEROOTPREFIX")
;; "C:\\Documents and Settings\\XPMUser\\Application Data\\Autodesk\\AutoCAD 2009\\R17.2\\enu\\"
;;;; this folder don't exist on this installation of 32 bit A2009 on XP system...
;;;; "C:\\Documents and Settings\\XPMUser\\Application Data\\Autodesk\\ApplicationPlugins\\"


;; Windows 7 Ultimate Service Pack 1 - my main PC
;; Under A2009 64 bit
;; (getvar "ROAMABLEROOTPREFIX")
;; "C:\\Users\\RIBAR\\AppData\\Roaming\\Autodesk\\AutoCAD 2009\\R17.2\\enu\\"
;; Under A2012 64 bit
;; (getvar "ROAMABLEROOTPREFIX")
;; "C:\\Users\\RIBAR\\AppData\\Roaming\\Autodesk\\AutoCAD 2012 - English\\R18.2\\enu\\"
;; Under A2014 64 bit
;; (getvar "ROAMABLEROOTPREFIX")
;; "C:\\Users\\RIBAR\\AppData\\Roaming\\Autodesk\\AutoCAD 2014\\R19.1\\enu\\"
;;;; this folder exist on this installations of 64 bit AC on Windows 7 system...
;;;; "C:\\Users\\RIBAR\\AppData\\Roaming\\Autodesk\\ApplicationPlugins\\"

;; Windows 7 Ultimate Service Pack 1 - my netbook
;; Under A2008 32 bit
;; (getvar "ROAMABLEROOTPREFIX")
;; "C:\\Users\\Marica\\AppData\\Roaming\\Autodesk\\AutoCAD 2008\\R17.1\\enu\\"
;;;; this folder don't exist on this installation of 32 bit A2008 on Windows 7 system...
;;;; "C:\\Users\\Marica\\AppData\\Roaming\\Autodesk\\ApplicationPlugins\\"

BTW. You don't need (vl-load-com); (vl-file-directory-p) function isn't dependable of loading Activex extensions

Marko Ribar, d.i.a. (graduated engineer of architecture)
Message 6 of 15

Ajilal.Vijayan
Advisor
Advisor

Thanks Marko for trying this code.

It seems you tested this code in A2009 & A2008 also.

But I think 'ApplicationPlugins' folder exists from A2012 version.

 

My main goal is to test this code with A2012/2013/2014 under Windows XP platform.

 

0 Likes
Message 7 of 15

marko_ribar
Advisor
Advisor

Sorry, I only have 32 bit XP emulation on my main PC and 32 bit XP on some other notebook and my old PC's... And as I don't posess instalation packages of AutoCAD 32 bit of A2012+, I can't install it to test of existance of plugin folder you specified... Are you looking for XP 64 bit system? I had once on some disk some installation of such system, but never really tried it...

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 8 of 15

hmsilva
Mentor
Mentor

Hi Ajilal,

 

installed a AC2012 in an old XP workstation, and

 

_$ (setq path (strcat (substr (getvar "ROAMABLEROOTPREFIX") 1( + 8(vl-string-search "Autodesk"(getvar "ROAMABLEROOTPREFIX"))))

"\\ApplicationPlugins\\"))
"C:\\Documents and Settings\\Henrique\\Application Data\\Autodesk\\ApplicationPlugins\\"
_$ (getvar "ROAMABLEROOTPREFIX")
"C:\\Documents and Settings\\Henrique\\Application Data\\Autodesk\\AutoCAD 2012 - English\\R18.2\\enu\\"
_$


Hope that helps
Henrique

EESignature

0 Likes
Message 9 of 15

marko_ribar
Advisor
Advisor

Henrique, you set variable path correctly, but haven't showed return after (vl-file-directory-p path)... Is it T or nil, or does plugin folder exist or no...

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 10 of 15

hmsilva
Mentor
Mentor

@marko_ribar wrote:

Henrique, you set variable path correctly, but haven't showed return after (vl-file-directory-p path)... Is it T or nil, or does plugin folder exist or no...


Hi Marko,

 

my bad...Smiley Embarassed

 

I am almost certain that the return was T, but I'm out of the office, only tomorrow can I test it again...

 

Henrique

EESignature

0 Likes
Message 11 of 15

Ajilal.Vijayan
Advisor
Advisor

Hi Henrique,

Its so kind of you to install A2012 and try the code, thanks for that.

 

Yes like Marko said, I am also looking whehter the 'path' variable returns T after (vl-file-directory-p path).

 

0 Likes
Message 12 of 15

hmsilva
Mentor
Mentor
Accepted solution

Hi Ajilal,

I did test the the directory existence, the problem was, I did test at office and send to my private email the output from the 'Visual LISP Console', and copy/past, not the entire output...

 

Here it is:

_$ (setq path (strcat (substr (getvar "ROAMABLEROOTPREFIX") 1( + 8(vl-string-search "Autodesk"(getvar "ROAMABLEROOTPREFIX")))) "\\ApplicationPlugins\\"))
"C:\\Documents and Settings\\Henrique\\Application Data\\Autodesk\\ApplicationPlugins\\"
_$ (vl-file-directory-p path)
T
_$

 

I hope this helps
Henrique

EESignature

Message 13 of 15

Ajilal.Vijayan
Advisor
Advisor

Thanks Henrique and Marko for testing the code.

0 Likes
Message 14 of 15

hmsilva
Mentor
Mentor
You're welcome, Ajilal
Glad I could help

Henrique

EESignature

0 Likes
Message 15 of 15

tmorrisonDPXBF
Explorer
Explorer

Logged on just to say thanks for posting this gem. 

0 Likes