1 Reply Latest reply on Nov 26, 2012 12:22 PM by Lee CS Young

    Upgrading SEPDM 'Viewer' between upgrades

    Corey Vantilborg

      This is an old issue for us.  However I thought I had come up with a clever solution this year.


      Each year when we upgrade SEPDM the Viewers (Right click >View File or History viewer) breaks.  This is because SEPDM stores the viewer paths by User, not locally on the computer, so it doesn't know when those paths have changed.


      Usually this is a very manual process to deal with, basically I have to go into every user and change this value, it is very time consuming, and dumb.


      This year I decided to try to upgrade it from the database.  To that end i wrote this SQL script


      update dbo.Settings

      set dbo.settings.Value = '* %ProgramFiles%\SolidWorks Enterprise PDM\FileViewer.exe "%1%" sldasm, sldprt, slddrw, dwg %ProgramFiles% (x86)\Common Files\eDrawings2012\EModelViewer.exe "%1%"'

      from dbo.Users left join dbo.GroupMembers on dbo.users.UserID = dbo.GroupMembers.UserID

      left join dbo.Groups on dbo.GroupMembers.GroupID = dbo.groups.GroupID

      left join dbo.Settings on dbo.Users.UserID = dbo.settings.UserID

      where dbo.GroupMembers.IsMember = 1 and dbo.groups.GroupID = '@DesiredUserGroup' and dbo.Settings.VarID = '16'


      The intention here to was to update the viewer string for everyone in our Engineering user group to a known good value.  Since I know that all of our Engineers user 64-bit machines I can at least do this much.


      The script does work, it that is updates the values in  dbo.settings .  However when I go into the UI after running the script I get this:

      11-26-12 11-00-41 AM.jpg


      Obviously I am missing something here.   When I look at all the Settings in SQL for that user, I can see that I did update the viewer setting, but obviously I am missing something.


      99Corey Vantilborg131T-EngineeringGB0
      99Corey Vantilborg131T-Engineering12
      99Corey Vantilborg131T-Engineering13
      99Corey Vantilborg131T-Engineering14
      99Corey Vantilborg131T-Engineering15
      99Corey Vantilborg131T-Engineeringdwg dxf eprt easm edrw sldprt sldasm slddrw pdf cfg mdb markup6
      99Corey Vantilborg131T-Engineering~$* *.newver.* *.bak *.tmp logoff*7
      99Corey Vantilborg131T-Engineering08
      99Corey Vantilborg131T-Engineering09
      99Corey Vantilborg131T-Engineering010
      99Corey Vantilborg131T-Engineering011
      99Corey Vantilborg131T-Engineering012
      99Corey Vantilborg131T-Engineering014
      99Corey Vantilborg131T-Engineering015
      99Corey Vantilborg131T-Engineering* %ProgramFiles%\SolidWorks Enterprise PDM\FileViewer.exe "%1%" sldasm, sldprt, slddrw, dwg %ProgramFiles% (x86)\Common Files\eDrawings2012\EModelViewer.exe "%1%"16
      99Corey Vantilborg131T-Engineering1,9,1,10,1,40,1,11,1,26,2,111,3,1,3,25,3,27,3,14,3,18,3,37,3,133,3,136,4,-118
      99Corey Vantilborg131T-EngineeringConstructs Elements Sheets Views19
      99Corey Vantilborg131T-EngineeringOldVersions20
      99Corey Vantilborg131T-Engineering1 021
      99Corey Vantilborg131T-Engineering022
      99Corey Vantilborg131T-Engineering123
      99Corey Vantilborg131T-Engineering024
      99Corey Vantilborg131T-Engineering125
      99Corey Vantilborg131T-Engineering126
      99Corey Vantilborg131T-Engineering027
      99Corey Vantilborg131T-Engineering028
      99Corey Vantilborg131T-Engineering029
      99Corey Vantilborg131T-Engineering030
      99Corey Vantilborg131T-Engineering031
      99Corey Vantilborg131T-Engineering032


      Has anyone worked with this before?  How do you upgrade all your viewers?



      Corey Vantilborg

        • Re: Upgrading SEPDM 'Viewer' between upgrades
          Lee CS Young

          Maybe you should try doing it the way the admin tool does;


          Begin Transaction
          DECLARE @DesiredUserGroup INT
          Create table #SetUsrs( UserID Int )
          Create table #SetVars( VarID Int, Value ntext )
          INSERT INTO #SetUsrs
                  GroupMembers gm
              JOIN Groups g ON g.GroupID = gm.GroupID
              WHERE g.GroupID = @DesiredUserGroup AND gm.IsMember = 1
          Insert Into #SetVars Values( 16,  '* %ProgramFiles%\SolidWorks Enterprise PDM\FileViewer.exe "%1%" sldasm, sldprt, slddrw, dwg %ProgramFiles% (x86)\Common Files\eDrawings2012\EModelViewer.exe "%1%"')
          Exec Set_WriteSettings 0, 2
          IF @@error <> 0 Begin Rollback Return End


          Note that the call to Set_WriteSettings second int parameter is the ID of the user that would be doing the update. (2) is generall y the admin.


          This way your history will be updated and I think (but don't know for sure) that might be where the problem lies.