Installing Civil 3D 2024 using PowerShell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm working on a PowerShell script to install/upgrade computers to Civil 3D 2024.
The major issue I'm encountering revolves around removing existing versions of C3D. For our application, we cannot have multiple versions of C3D on a computer, so I have to be rid of any version prior to the current one.
If there's no previously existing install of C3D (any version), install works as intended and indeed works quite well.
Where the problem occurs is if some version is already installed be it 2023 or 2024.
My script searches the uninstall keys portion registry for applications having "Civil 3D" in their Display Name. Anything it finds, it loads the related uninstall string into an array followed by running each uninstall string, waiting until the process completes before performing any remaining uninstall string.
The script has no difficulty obtaining the uninstall strings and runs them without issue. Except for one crucial problem.
Nothing actually uninstalls. Nothing! Doesn't matter if the software uses MSIEXEC or AdODIS, nothing gets uninstalled. I know the method for obtaining uninstall strings and executing them works, the code works without fail for other manufacturer's products with only the search string changed. But not the Autodesk.
Because the issue is not limited to AdODIS and includes MSIEXEC, I hesitate to say it's an Autodesk problem. At the same time, the code works for other non-Autodesk software.
I'll readily admit I'm not any kind of expert on PowerShell so I expect (hope?) somebody will point out a silly syntax error causing all my problems.
Two final details, while the script is intended to run from SCCM I have a batch file which issues the same commands SCCM would use and I do run it as administrator. I've attached a copy of my script with a TXT extension appended. If you want to run it, just remove the .txt extension.
Thanks!