Appdata in Public Folder on workstations

Appdata in Public Folder on workstations

RockyBrown4134
Collaborator Collaborator
2,013 Views
9 Replies
Message 1 of 10

Appdata in Public Folder on workstations

RockyBrown4134
Collaborator
Collaborator

I'm not sure if this is the correct way to achieve my goal, but it doesn't hurt to ask. 

 

When I install AutoCAD or any Autodesk product on a given machine, it creates an Appdata folder in the Users directory, based on the NT login account:

 

C:\Users\NTuser12345\appdata\roaming\autodesk\autocad 2023\r24.2\enu\support, where NTuser12345 is the user account. 

 

In my support paths, I would like this to be in the "Public" users folder. I am using support paths that are located on the server and I am setting them through the profile .arg file. This is common for about 20 workstations.

 

How do I get this data to the same folder on each of the machines? Can I just move or copy the folder to Public user?  Or is there another or better way to do this? I don't want to have to set up each workstation every time we upgrade. All and any comments are welcome. 

 

If this response answers your question, Please mark this response as "Accept as Solution"

Rocky Brown
AutoCAD 2020 / Inventor 2020 / Plant 3D
0 Likes
Accepted solutions (1)
2,014 Views
9 Replies
Replies (9)
Message 2 of 10

paullimapa
Mentor
Mentor

unsupported solution from Autodesk:

How to change the path of the user profile in AutoCAD (autodesk.com)


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 10

RockyBrown4134
Collaborator
Collaborator

So, this would have to be done on each workstation. That defeats the purpose, doesn’t it?

Besides, this really is not supported.  Perfect world would be to make this setting during the install. I may try this on a test machine and see what happens. 

If this response answers your question, Please mark this response as "Accept as Solution"

Rocky Brown
AutoCAD 2020 / Inventor 2020 / Plant 3D
0 Likes
Message 4 of 10

Simon_Weel
Advisor
Advisor

What's the reason for having that data in the same folder for all users?

0 Likes
Message 5 of 10

RockyBrown4134
Collaborator
Collaborator

We use a custom profile (.arg file) to set all of the support paths on our server. All the support paths on the root drive of each machine, the "appdata" folder is the only one that differs. It is based on each users NT account login. Since the profile is located on the server, I would prefer all of the support paths to be in the same location on each workstation. Updating one profile is easier and more convenient than updating multiple instances, especially when there's 20+ or more.

 

If there's another way to achieve this, I'm all ears.

If this response answers your question, Please mark this response as "Accept as Solution"

Rocky Brown
AutoCAD 2020 / Inventor 2020 / Plant 3D
0 Likes
Message 6 of 10

Simon_Weel
Advisor
Advisor

Ok, so you want to push a custom AutoCAD profile to each user. There are several ways of dealing with this. I use acad.lsp to check the current profile and if it isn't the company-wide one, it's loaded and made active. This is a new-user-first-time action.

Code snipped:

(setq profile_name   (strcat "AUTOCAD " version " KB")
        acadsuppad "<network share>"
        profile_path    (strcat acadsuppad "PROFILES\\")
        acad_profiles  (vla-get-profiles (vla-get-preferences (vlax-get-acad-object)))
        active_profile (strcase (vla-get-activeprofile acad_profiles))
  )
  (vlax-invoke-method acad_profiles 'getallprofilenames 'profile_list)
  (setq profile_list (vlax-safearray->list profile_list)
        profile_list (mapcar '(lambda (list_changecase) (strcase list_changecase)) profile_list)
  ) ;_ end of setq
  ;;
  ;; Load KB Profile if not available
  (if (not (member profile_name profile_list))
   (if (findfile (strcat profile_path profile_name ".ARG"))
    (progn
     (vlax-invoke-method
      acad_profiles
      'importprofile
      profile_name
      (strcat profile_path profile_name ".ARG")
      :vlax-true
     ) ;_ end of vlax-invoke-method
     (vla-put-activeprofile acad_profiles profile_name)
     (setq restart_acad (open (strcat (getenv "Temp") "\\restart_acad.cmd") "w"))
     (write-line "@echo off" restart_acad)
     (write-line "set slp=sleep.exe" restart_acad)
     (write-line ":check_acad" restart_acad)
     (write-line "%slp% 1" restart_acad)
     (write-line "qprocess acad.exe" restart_acad)
     (write-line "if [%errorlevel%]==[0] goto check_acad" restart_acad)
     (write-line (strcat "start \"restart_acad AutoCAD\" \"" <path to acad.exe> "acad.exe\"") restart_acad)
     (close restart_acad)
     (alert
      "AutoCAD doesn't use the right configuration.\n\nClick OK to shutdown and restart AutoCAD.\nThe configuration will then be modified."
     ) ;_ end of alert
     (dos_command (strcat (getenv "Temp") "\\restart_acad.cmd") 3)
     (command-s "quit" "no" "")
  

Support paths can change over time, but instead of pushing out a modified profile, I again use acad.lsp to change / add support paths - saves me the hassle of restarting AutoCAD to make sure all profile settings get activated.

(setq acaduserpad   (strcat (dos_specialdir 5) "AutoCAD\\")
      paden (vla-get-files (vla-get-preferences (vlax-get-acad-object)))	  
      acadsuppad 	"<network share>"
      userprofilepad (getvar "RoamableRootPrefix")
) ;_ end of setq

(setq suppad (strcat (vl-string-right-trim "\\" acaduserpad)
                     ";" acadsuppad "apps;"
					 acadsuppad "support;"
					 userprofilepad "support;"
					 acadsuppad "<your folder>"
             ) ;_ end of strcat
) ;_ end of setq
(if (/= (strcase (vla-get-supportpath paden)) (strcase suppad))
 (vla-put-supportpath paden suppad)
) ;_ end of if

The command dos_specialdir isn't native AutoLISP but a function of DOSLib.

 

Another approach could be copying the company profile to the users Windows profile using the login script. And there are a number of other ways to do the same thing.

Message 7 of 10

RockyBrown4134
Collaborator
Collaborator

This is interesting. I need to read it through later. I might need to brush up on my LISP to understand it better. Thanks.

If this response answers your question, Please mark this response as "Accept as Solution"

Rocky Brown
AutoCAD 2020 / Inventor 2020 / Plant 3D
0 Likes
Message 8 of 10

RockyBrown4134
Collaborator
Collaborator

Okay, Couple of questions. 

1. DOSLib - Is it shareware or a purchased application? I didn't see any indication on the link you provided. I may have just overlooked it.

 

2. When I install newer versions of Autodesk Software, such as AutoCAD, the install is going to put the data under the user's profile. In my case, it's by the NT account. Where is this data placed on your installs? What is the difference between how you are installing the software and how I'm installing the software? (Yes, I know it's a vague question.)

 

3. I must be overlooking something or doing something different or not doing something correctly. What is it? Has to be something simple. 

 

FYI....I have been doing this for 39+ years. I have probably forgotten more than I remember. But I don't recall ever having this issue until the last several releases. 

 

However, I really like the concept you are doing with this. It helps maintain a companywide CAD standard.

If this response answers your question, Please mark this response as "Accept as Solution"

Rocky Brown
AutoCAD 2020 / Inventor 2020 / Plant 3D
0 Likes
Message 9 of 10

Simon_Weel
Advisor
Advisor

1. DOSLib - Is it shareware or a purchased application?

I'ts Open Source - about halfway the page of the link.

 

2. When I install newer versions of Autodesk Software, such as AutoCAD, the install is going to put the data under the user's profile. In my case, it's by the NT account. Where is this data placed on your installs?

Same place. But also - all corporate content like line types, hatch patterns and LISP apps (basically all the stuff that's copied to a users Windows Profile, but then more or less modified) are on a network share. 

I don't modify deployment settings for the content, since that most likely will bite me one day. In the 'old' days (pre-2022 versions), I added the support path for the network share to the deployment, as the first in line:

Simon_Weel_0-1692106273956.png

L:\AutoCAD\Apps being the shared folder holding all LISP files, including acad.lsp. So when a user started AutoCAD for the first time, AutoCAD would look for acad.lsp and acaddoc.lsp etc. in the defined search paths. And it would pick up acad.lsp in that shared folder and execute it, load the correct profile, modify different paths etc.

 

Unfortunately, the new deployment method as of version 2022 doesn't have this option. The customizations I make for these new deployments are the Trusted Locations (the network share containing the corporate support files), Exclude the Start In and drawing folders , Load acad.lsp once at the start of the session and have the Express Tools installed. Since you can no longer alter the Search Paths in the deployment, I created a simple acad.lsp that's copied to the local Support folder (C:\Program Files\Autodesk\AutoCAD <version>\UserDataCache\Support) by the installation batch file. The simple acad.lsp is picked up when a user starts AutoCAD the first time; it changes the Support Paths and then restarts AutoCAD. The relaunched AutoCAD then picks up the corporate acad.lsp which in turn makes additional modifications and restarts AutoCAD again.

It's not elegant, but since it's a one-time action, I think it's acceptable. This is the local acad.lsp:

 

 

;;******************************************************************************
;;******************************************************************************
;;**                                                                          **
;;** The local version of Acad.lsp is executed after starting AutoCAD         **
;;** It changes the support paths and displays a message to restart.          **
;;**                                                                          **
;;******************************************************************************
;;******************************************************************************

(setvar "cmdecho" 0)
(princ "Execute ACAD.LSP - local version...")
;;------------------------------------------------------------------------------
;;-- Visual LISP                                                              --
;;------------------------------------------------------------------------------
(vl-load-com)

;;------------------------------------------------------------------------------
;;-- Set Options on tab 'Files'                                               --
;;------------------------------------------------------------------------------
 (setq acadsuppad "L:\\AutoCAD\\"
	   userprofile_path (getvar "RoamableRootPrefix")
	   support_paths (vla-get-files (vla-get-preferences (vlax-get-acad-object)))
       old_suppaths (vla-get-supportpath support_paths)
	   )

 (if (not (wcmatch (strcase old_suppaths) "*L:\\AutoCAD\\apps*"))
 (progn
		(vla-put-supportpath support_paths (strcat "L:\\AutoCAD\\apps;" old_suppaths ))
		(setvar "TrustedPaths" (strcat acadsuppad "apps\\...;" acadsuppad "cot\\...;" acadsuppad "support\\...;" userprofile_path "support\\..."))
		(alert "AutoCAD doesn't use the correct configuration.\n\nClick OK to close AutoCAD and then restart it.\nThe configuration will then be modified.")
		(command "quit")
 )) ;_ end of if

;;------------------------------------------------------------------------------
;;-- End acad.lsp                                                           --
;;------------------------------------------------------------------------------
(princ "\nLocal ACAD.LSP is processed.")
 

 

 

Path "L:\\AutoCAD\\" is the network share. The code also changes the trusted paths, since I didn't get them right in the deployment 🙂

 

edit: after the corporate acad.lsp is executed, the local support path is no longer first in line, so the local acad.lsp will not be executed subsequently.

 

As for question #3 - I'm not sure what the questions is?

 

Message 10 of 10

RockyBrown4134
Collaborator
Collaborator
Accepted solution

I apologize for not getting this response posted earlier.

 

I did find a way to achieve what I was looking to do. I took a little research, but I found a tool in the "Custom Installs" section of the portal.  I had to create a custom deployment, selecting the products I wanted to install. In this case, AutoCAD with a Toolset. I clicked the "Product" in the left pane and a Product Pane displayed on the right.  

 

RockyBrown4134_0-1699619840060.png

 

I selected the "Customization" drop down and it gave me several options to choose from. The first option was "Custom Folder". This is what I was looking for. It gave me a field to enter in the custom folder location to install the support files that is usually installed in the Appdata folder. 

 

RockyBrown4134_1-1699620408802.png

Once I entered the folder path in the field, I followed the prompts to finish the deployment.  I clicked the "Next" button and continued to the "Install Settings" Tab. I set the deployment image path in the appropriate field, and saved my deployment. I later downloaded the deployment to a folder we use for software installation. When I ran the deployment, the files were place where I wanted them to be. 

 

There is always several ways to do all tasks. This might not work for some, but it resolved my issue. I'm not saying this is the correct way, but it's another way. 

 

Thank you for all of the good suggestions. There is a few I still want to explore. 

If this response answers your question, Please mark this response as "Accept as Solution"

Rocky Brown
AutoCAD 2020 / Inventor 2020 / Plant 3D
0 Likes