8 Replies Latest reply on Jan 14, 2019 6:12 PM by Paul Wyndham

    Fully automating SW Image Installations (What SolidWorks doesn't tell you...)

    Scott Wheeler

      This will hopefully save some fellow CAD Admins and users headaches, since a lot of these details aren't well documented and only learned through trial & error.

       

      Our particular installation scenario is for 90+ users across multiple sites with the majority of SolidWorks software packages installed, including PDM, Electrical, all the Simulations, Composer, Inspection,etc.  We have a shared Toolbox folder within the PDM Vault, which adds complexity to the install process, and I also have a handful of users who only use E-Drawings as a viewer, but still need access to PDM Vault files.  In past years this was a manual roll out, where the Admin Image was configured and e-mails were sent to users for them to click on hyperlinks and run the install (.hta) file.  The challenge with this was ensuring users actually do the install, and then users have to wait 1-3 hours for an install to complete.

       

      This year we automated this process, so as soon as the servers are updated we push the install out.  This results in users simply leaving their computers running, logged in, screen locked at the end of the day.  With the scripts below the installations happen off hours and are 100% hands-free.  For a user base as large as ours, this is a great approach to take, but does require some specific setup steps.

       

       

      So the basics I assume most CAD admins would know..but here's to putting all relevant info in one thread/spot.  Download the desired version/service pack installer and then run.  I strongly recommend selecting the option to download all files versus a straight up install at this point.  Once downloaded, you can then create an Admin Image.  I first create the Admin Image on my local drive while I'm developing and testing.  (i.e. C:\SW Images\2018)  Once testing is complete, use RoboCopy to confidently copy all files to a shared network folder for distribution purposes.  Note, all users will need at least read-access to this network folder location.  Read-Write is not needed, but if that permission is enabled it allows you to see log files for each computer the image was installed on.  (That can be useful to debug a failed install.)

       

      Some suggestions on the Admin Image settings to avoid headaches.

      • Make your Global settings the "Default" installation you'd want for any computer.  This allows any computer to have SW installed without being listed in a specific Group in your admin image.
        • For some, default would best be only the core SolidWorks files and then Groups could be created for additional add-ins to be installed on designated computers.
        • For others, Global Settings should be a default where full SolidWorks and all add-ins are installed. This is less maintenance initially and over time as computers come and go.
      • For Client Installation Options, check "Do Not Activate Automatically".  Odds are you have a SolidNetWork License Manager if you are trying to automate the installation process on many computers, and are not upgrading machines with static licenses.
      • For Administrative Options, check Run a Program after installation and point it to your BAT file.(see below)  Also check "Yes, I want to join" for participating in the Customer Experience.  This allows you to use the CAD Admin tool in the SolidWorks Customer Portal.
      • For the Toolbox/Hole Wizard options, set this folder to C:\Temp.  (This is temporary, since in our case the Toolbox is a shared folder in the PDM Vault)

       

       

      I prefer to install SolidWorks outside of an image install on my sandbox computer, but the image could be used at this point to for the first install.  Once installed, open and run the SolidWorks software, take time to configure all the various settings, such as File Locations for templates, any menu customization's, etc.  Do not simply copy last year's CopySettingsWizard sldreg file.... this is bad practice.  It's well documented oddball errors occur when doing this, where options are added, removed, or moved within menus.  I find it works best to have two computers running side by side and evaluate the options to see what is new.  Also, set the Add-Ins to your desired preference for how you want users to initially run SolidWorks.

       

      Once you are happy with all this, then use the Copy Settings Wizard to create and save a new .sldreg file to a designated folder.  I create a folder for all my custom files, again locally before copying to a network folder (C:\SW Images\MySettings\)  Now, make a copy of this .sldreg file and remove the 'sld' portion of the filename, which I save as swSettings2018.reg.  This makes it a standard reg file which you can then just add to a computer to push the settings.

      Note - I'm well aware that in 2017 SolidWorks added functionality to push and lock (if desired) these customizations found in the Copy Settings Wizard.  However, in 2017 there were many bugs with this and in 2018SP2 some bugs were fixed while several others were created.  It simply is not reliable and a major headache to avoid for now...

       

      Go to RegEdit and export Computer\HKEY_CURRENT_USER\Software\SolidWorks\AddInsStartup, save in MySettings\AddInStartup.reg

       

      So at this point you have your Admin Image files in one folder and two .reg files in another.  Now a BAT file is needed to start tying it together.  Create a BAT file by just renaming a .txt file to .bat, save in MySettings folder, and using Notepad to create and modify the contents.  Here is my "Run After.BAT" file and I'll explain each line's function:

       

      @echo off

      echo .

      echo .

      echo .     *******************************************************

      echo .     *  Applying <company name> custom SolidWorks settings. *

      echo .     *         Please do not close this window!            *

      echo .     *******************************************************

      echo .

      echo .

      So this section above just displays on the CMD window what is going on.  This BAT file runs after the SW Image has completed the install, so the Installer window is still up at 100% install and then this BAT file runs.

       

      : Install Custom Properties add-in

      : Copy files

      xcopy /s /i /q /y "\\corp.companyname.com\Global SW Deployment\SolidWorks\EhCanadian Consulting, Inc" "C:\Program Files\EhCanadian Consulting, Inc"

      : Register the DLL

      cd /d C:\Windows\Microsoft.NET\Framework64\v4.0.30319

      RegAsm.exe "C:\Program Files\ehcanadian Consulting, Inc\Copy Properties\CopyProperties.dll" /codebase /s

      : Push Registry Keys

      START /WAIT REGEDIT /s "\\corp.companyname.com\Global SW Deployment\SolidWorks\MySettings\HKCU Copy Properties.reg"

      START /WAIT REGEDIT /s "\\corp.companyname.com\Global SW Deployment\SolidWorks\MySettings\HKLM Copy Properties.reg"

      This above section is for installing a custom API that we had developed externally, but this applies for any API.  A few things to take note of.

      • The API's install files are copied with XCOPY from a network folder to the user's local folder with certain switches enabled
      • Network folder paths use the UNC folder path, not a mapped letter folder path.  (You can't guarantee your users will have the same mapping.)

       

      : Push custom SolidWorks Settings

      START /WAIT REGEDIT /s "\\corp.companyname.com\Global SW Deployment\SolidWorks\MySettings\swSettings2018.reg"

      This section is pushing the reg file created from the CopySettingsWizard. 

       

      : Set status of add-ins in SolidWorks

      START /WAIT REGEDIT /s "\\corp.companyname.com\Global SW Deployment\SolidWorks\MySettings\AddInStartup.reg"

      This section pushes the status of all the SolidWorks Add-Ins.  This is useful, because the Image Install offers no control, and by default will enable certain add-ins.  For example, Inspection is always enabled.  It depends on the add-in, SolidWorks does not universally set add-ins on or off.  If you have floating licenses, this is a great way to specify an initial status of add-ins.

       

      : Set ToolBox Location to PDM Vault

      reg add "HKEY_CURRENT_USER\Software\SolidWorks\SOLIDWORKS 2018\General" /v "Toolbox Data Location" /t REG_SZ /d "C:\EPDM\SW Tool Box" /f

      Recall in the Admin Image the Toolbox was set to C:\Temp.  Why?  Because if the installer is done with the Toolbox pointing to a PDM Vault folder it will trigger a PDM login and halt the installer process.  By telling the installer to use a non-Vault folder, the PDM login dialog never pops up.  This registry add re-points the Toolbox folder to the PDM Vault folder.

       

      : Set Last Open Folder

      reg add "HKEY_CURRENT_USER\Software\SolidWorks\SOLIDWORKS 2018\General" /v "Last user path" /t REG_SZ /d "C:\EPDM" /f

      This is a small nitpick, but a variety of settings in SolidWorks are based on the Last Used folder or selection.  When you export your CopySettingsWizard it also grabs the Last Opened Folder setting.  Rather than have all my users initially opening files in my test environment folders, I default this to the PDM Vault root folder.

       

      : Reboot computer

      echo .

      echo .

      echo .     *******************************************************

      echo .     *      SolidWorks installation was successful.        *

      echo .     *      Computer will now restart in 30 seconds.       *

      echo .     *******************************************************

      echo .

      echo .

      timeout /t 5

      shutdown.exe /r /t 25

      This last section simply forces a reboot at the end of the installer process.  The timeout allows the command window to be displayed for the status, and then 25 seconds are allowed to pass before the forced restart is executed.

       

      The last key to the puzzle is pushing the install process itself.  We use our Active Directory database to push to a group of computers with the current version of SolidWorks installed.  Another BAT file should be created with the two items below in it to successfully push an install.

      reg add "HKCU\Software\SolidWorks\Applications\PDMWorks Enterprise\Security" /v "EULA Accepted 2018 18 2 %COMPUTERNAME%" /t REG_SZ /d "Yes"

      The first command is needed to avoid having a user accept the End User License Agreement dialog box that pops up during the install process.  Note it is specific to the version of software and the Computer name.

      "\\corp.mycompany.com\Global SW Deployment\SolidWorks\2018\startswinstall.exe" /install /now /showui

      The last command  is the actual command to launch the SW Image installer.  It forces the install to occur immediately, and shows the installation dialgox box.  The only reason to show the UI for an automated install script like this is when something goes wrong.  The user comes back to their computer expecting the update to be done, and if it gets stuck somewhere at least there is some visible clue as to where it got stuck and that something isn't right.

       

      That's about it.  Hopefully some of these tips help out some folks!

        • Re: Fully automating SW Image Installations (What SolidWorks doesn't tell you...)
          Mikko Laine

          Very good post!

           

          I'm our PDM Admin and the user with most knowledge in SW usage and administration at our company but our "outsourced" IT department won't grant me permissions to fully administer SW, so I have to give our IT support guidance how to set up the admin images... So regarding this, should it be possible somehow to attach a PDM Vault and Toolbox during the installation of a fresh copy of SW?

           

          Another question is about deleting the Toolbox files installed into C:\Temp\? Does your company configure the user systems so that the temp is emptied periodically?

          • Re: Fully automating SW Image Installations (What SolidWorks doesn't tell you...)
            David Mandl

            TL;DR

             

            Just kidding, I'm definitely bookmarking this for future reference.

            • Re: Fully automating SW Image Installations (What SolidWorks doesn't tell you...)
              Chris Saller

              Thank for the info.

              Curious, any changes needed for users using either PDM, PDM Standard, or PDMWorks?

                • Re: Fully automating SW Image Installations (What SolidWorks doesn't tell you...)
                  Scott Wheeler

                  In terms of what I posted, I can't think of why it would be specific to the version of PDM installed.  That said, within the SW Image settings there are options for PDM to set.  Specifically, if you'll want to specify PDM Professional if that is what you have, because by default Standard is selected and it can create headaches when the functions of Professional mysteriously do not work or a user cannot login all of sudden.  And by "default", also be aware that sometimes a simple Service Pack upgrade will affect your settings when making a new Image based off an existing Image settings.  Never trust this, I've been burnt too many times on Service Pack upgrades of images.  Lastly, PDM options in the Image settings exists for the various add-ins for software you may want to use, from SolidWorks, AutoCAD, DraftSight, and even MS Office products.

                • Re: Fully automating SW Image Installations (What SolidWorks doesn't tell you...)
                  Paul Wyndham

                  Nice write-up Scott.

                  Some things I have found that have helped my past installation to be more successful.

                   

                  *** Close applications that are running that might interfere with the installation: WINWORD, EXCEL, POWERPNT, OUTLOOK, iexplore, dsHttpApiService, dispatcher, SLDWORKS, EdmServer, ViewServer, ConisioAdmin, sldProcMon, sldworks_fs, swVBAServer, remotesolverdispatcherservice, explorer

                   

                  Hopefully the users exited out of everything on their own, but you never know.

                  You can user a line like TaskKill /f /im "winword.exe" to close word. If you are running as a script in on a locked computer it might stop the install if word wants the user to save the file. So, that is up to you. Forcing a restart would dump any changes as well.

                   

                   

                  *** Think about the options to Uninstall the previous version, upgrade it or install a new version along side it.

                  If possible I would prefer to uninstall the old version as it allows for a cleaner install. Another option is to have the new installation go to a folder other than the SolidWorks Corp folder. If you allow it to default to that location you could start to get a pile-up of SolidWorks (1), SolidWorks (2), SolidWorks (3) ... SolidWorks (N) folders. It then starts to get hard to troubleshoot some issues if you don't know exactly where the executable is. If you create a SolidWorks 2019 folder for example it makes it straight forward. Or Uninstall the previous version and have it completely remove all of the old version including registry settings.

                   

                  *** As Scott pointed out DEFINITELY make sure the Inspection add-in is not turned on by default when the installation completes. If you have 600 users and one inspection license the one guy that needs it will never get it because everyone else will grab it any time it is available when they start SolidWorks.

                   

                  *** The command to silently run view setup from the cvs file is: ViewSetup.exe PDMWEVault.cvs /q (that came from the install document for convenience).

                   

                  *** Pre-Requisites can cause problems. If you use the admin image you might have issues if you already have the same or newer version of a pre-req installed. Sometimes the pre-req installer notices that the version is already installed so it exists out of that installation. The admin image notices that the pre-req did not finish installing but doesn't know why so it errors out. I have not tried this out on 2018 or 2019, so it might have been fixed.

                   

                  *** Is the admin image right for you or would SCCM be better?