Sunday, August 30, 2015

Fixed: Solidworks 2015 x64 on Windows 10 Application Compatibility Shim


My customer is upgrading to Windows 10, and they found that SolidWorks 2015 crashes every time you try to Open or Save a part or assembly.  File > Open > Crash or File > Save as > Crash

I fixed it.  The fix and steps to install it are at the bottom of this post.

The application works, slowly, if you run it in "Windows 8 compatibility mode".  Compatibility Mode lets you arm-twist your older applications to run on newer operating systems by turning on many different compatibility shims.  Some of these shims, like registry virtualization, can have a significant performance impact.  The performance hit comes from the extra layer of translations and safety checks required to make Windows 10 "look like" Windows 8.  In my not-quite-enough-RAM-in-the-system case, these shims slow the application noticeably.

I made a better fix.


Microsoft publishes the Application Compatibility Toolkit that lets you create custom application compatibility shims.  By applying and testing the Win8 shims one-at-a-time I was able to get SolidWorks working with only a single (fast) compatibility fix.   The secret sauce for SolidWorks 2015 on Windows 10 is to lie to it when it asks what OS is running.  I accomplished this with the fantastically named Win8RTMVersionLie * shim.

* I'd love to link to the Win8RTMVersionLie documentation here but I couldn't find it online.  The documentation for VistaRTMVersionLie is here instead.  The TLDR version is it does what the name says it does.

Here is what the completed shim looks like in Compatibility Administrator.

Once these shims are created they are stored in Shim Database (*.sdb) files.  The SDBs are installed with the built-in tool SdbInst.exe.


I've packaged this compatibility shim and a couple of batch files to install and uninstall it.

Getting/Installing the Fix:

1. Download the .zip file SolidWorks2015Win10Fix.zip
2. Extract it to a folder.
3. Right-Click "InstallFix.Bat" and select "Run as Administrator".
4. Accept the UAC Prompt.

That's it.

To Uninstall the fix (i.e. if Dassalt releases a proper update) Right-Click "UninstallFix.Bat" and select "Run as Administrator".

Magic!

Leave a comment if you'd like to see more posts on Application Compatibility.  It is a tiny technology niche, but the ability to make old apps run on a modern OS can be huge!

Update:
If Windows Smartscreen blocks the batch files you can right-click them, go to properties, and click "Unblock".  Alternately you can install the fix with sdbinst "Solidworks 2015x64.sdb" at an administrative command prompt.

Tuesday, August 18, 2015

Windows 10: Change a network connection from Private to Public

Today I accidentally set a hotel wifi hotspot as a private network. Network discovery is turned on for private networks, and immediately I could see a dozen computers, a couple of printers and a Windows homegroup.

Oops.  This is "not great".

Changing a network type from Private to Public or Private to Domain is not intuitive at all in Win10.  I tried the Network and Sharing Center.  I tried Network Settings.  I tried right-clicking the network connection.  I poked around in the NIC settings.  I tried [a lot] and failed utterly.

I finally found a solution on one of Mark Minasi's old newsletters at
http://www.minasi.com/newsletters/nws1304.htm

The trick is to use powershell.

Click Start
Type PowerShell
Right-Click Windows Powershell and select "Run as Administrator"
In the Powershell Prompt:
Type "Get-Netadapter" to list your network adapters.
Type "Get-NetConnectionProfile -InterfaceAlias "Your Adapter name here"" to get the connection name.  Most people will have "Wi-Fi" as the adapter name.  Mine is a little different because I am using Hyper-V to carry around my lab machines.
Type "Set-NetConnectionProfile -name "yourNetConnectionHere" -NetworkCategory public" to change the connection to public.
Type "Get-NetConnectionProfile -name "yourNetConnectionHere"" to verify the change.

It works, I'm happy. 

Changing Network from Private to Public in Windows 10
Thanks Mark!  Magic!