Windows 7 MSI AutoCAD 2016 Set Default User Settings

From richud.com
Jump to: navigation, search


Fixing AutoCAD 2016 MSI

The default AutoCAD user settings are split between AppData/Local and AppData/Roaming, for reasons unknown.

In the infinite wisdom of 'where I work', only the Roaming folder is kept on a server as part of the users profile (profile redirection), the other is only kept locally - and scrubbed every week on machine shutdown! Obviously this knobs over various things and causes all manor of odd problems.

In particular this breaks AutoCAD in function as the settings are lost and because it cannot re-create the needed paths and errors on startup.

This fix does two things, it makes both lots of settings go to AppData/Roaming and it fixes anyone's profile that previously existed to do this.


This patch 'psfix.mst' applies to ...\%platform%\%lang%\Acadm\AcadmPS\AcadmPS.msi which for me equates to ...\Img\x64\en-US\Acadm\AcadmPS\AcadmPS.msi

CustomAction Table

This redirects what would go to Appdata/Local to AppData/Roaming

CustomAction table

Directory Table

As in my situation the Appdata/Roaming gets served directly from the server, this keeps any graphics cache data locally in the temp folder.

This also has the added benefit that Temp will get wiped on machine shutdown and not get clutted up with stuff that apparently is the cause of various other Acad problems. (so I have read about)

Directory table

Registry Table

This was the most difficult bit to solve, Acad doesn't use healing or any other normal MSI technique for repair etc. but relies on the value of this HKLM setting matching the HKU one. If it doesn't match it triggers a repair.

This is thus used to change user settings for anyone who already has a Acad profile and currently has settings to both parts of AppData.


This seeds HKLM (Root 2) with an 'A' appended to the name (arbitrarily chosen)

Registry table


This seeds HKU (Root 1) with an 'A' appended to the name

Registry table


This changes the Component it belongs to so when the healing occurs, this gets changed too.

Registry table

Applying

This patch psfix.mst applies to ...\%platform%\%lang%\Acadm\AcadmPS\AcadmPS.msi which for me equates to ...\Img\x64\en-US\Acadm\AcadmPS\AcadmPS.msi

Add 'TRANSFORMS=psfix.mst' to ...\Img\mech2016.ini, under the [ACM_MAIN] section, to get it applied with no further effort. Should end up like this

[ACM_MAIN]
<snip>
CONFIG_TRANSFORM=AcadmPS-mech2016.mst
EMBEDDED_TRANSFORMS=
STOCK_TRANSFORMS=
TRANSFORMS=psfix.mst
PATCHES=

[ACM_MAIN_en-US]

And I replaced the hard coded absolute path the (admin install thing) ini generator made with %~dp0

#============================= Global MSI Properties =============================
<snip>
ADMIN_IMAGE_LOCATION=%~dp0

So my ...\install.bat is just this (with a pushd as it doesn't work with paths for some reason?!) which can be kicked off via psexec easily enough with a mapped drive.

pushd "%~dp0Img"
start /wait "" Setup.exe /q /I mech2016.ini /language en-us

FYI The dir structure I have is

.
├── AutoCAD_Mechanical_2016_English_Win_64bit_dlm.sfx.exe
└── install
    ├── Img
    │   ├── 3rdParty
    <snip>
    │   ├── en-us
    │   ├── eula
    │   ├── Imgx64.ini
    │   ├── mech2016.ini
    <snip>
    │   ├── x64
    │   └── x86
    ├── psfix.bat
    ├── install.bat
    ├── mech2016.lnk
    ├── SMS_SCCM scripts
    └── Tools

Fixing an already installed AutoCAD 2016

This psfix.bat pokes the transform into Windows and does a reinstall repair , which will then trigger a repair when user logs in next as their HKU key (as explained above above) wont match the new HKLM.

  • note the product number may be different for you if the language etc is different?
  • note the mapped drive S to source folder
@echo off
reg add "HKLM\SOFTWARE\Classes\Installer\Products\7D2F3875500F9040122000060BECB6AB\SourceList\Net" /v "2" /t REG_EXPAND_SZ /d "s:\Img\x64\en-US\Acadm\AcadmPS" /f
copy /y "%~dp0Img\x64\en-US\Acadm\AcadmPS\psfix.mst" "c:\windows\Installer\{5783F2D7-F005-0409-2102-0060B0CE6BBA}"
reg add "HKLM\SOFTWARE\Classes\Installer\Products\7D2F3875500F9040122000060BECB6AB" /v "Transforms" /t REG_EXPAND_SZ /d "C:\Windows\Installer\{5783F2D7-F005-0409-2102-0060B0CE6BBA}\psfix.mst;C:\Windows\Installer\{5783F2D7-F005-0409-2102-0060B0CE6BBA}\AcadmPS-mech2016.mst" /f
start /wait "" msiexec /i {5783F2D7-F005-0409-2102-0060B0CE6BBA} REINSTALL=all REINSTALLMODE=um ADSK_SETUP_EXE=1 /q
reg delete "HKLM\SOFTWARE\Classes\Installer\Products\7D2F3875500F9040122000060BECB6AB\SourceList\Net" /v "2" /f

Comments

I have written this as it may help someone who wants to modify some other aspect of the default user settings for Acad ! (and maybe get them applied after the fact!)


blog comments powered by Disqus