4 Replies Latest reply on Jan 10, 2011 11:12 AM by DanDinolfo

    User Centric Software Distribution - a Myth?

    Apprentice

      Hi,

       

      I would like to open a discussion about software distribution with LANDesk and the User Context. I have read some pptx from LANDesk explain that the user will be centric on the next product version. I hope, because now it's not really the case. I will explain why based on a true case study I'm facing today.

       

      Big company, worldwide (80 sites / region), 10'000 devices and around 350 business appications. A majority of these applications have some settings that need to implement into the user context, means some registry settings HKCU, some INI, XML file in the user profil, etc...

      The solution we are trying to implement is using one MSI SD package. This packages will run in the system context. Then to apply settings based on the user, another package (VBS) will put the user settings and of course will run in the user context. And then doing a scheduled task, that will run in the main package the MSI and in the final package the VBS. It works quiet fine, but with that we cannot handle all different scenarii.

       

      • First of all if no body is logged on, the task failed (VBS) it's difficult to debug and to know what is true or not...
      • Second if another user is logged on, the user part of the packages will not apply.
      • Third, if the settings change after installation. For example, we have some application that need to have the user connexion server in a HKCU key. If we migrate the server how do we distribution the users settings update??

       

      I'm sure you are thinking about login script, GPO or GPOP. But not really. The problem is, applications that need user settings, are often site based, means we need to create around 350*80 GPO (in the worst case). Not really a solution. And I do not talk about the Login script (something like 50 pages!). Jmac tell me also that you can change the shortcut of the applications to apply settings, yes it works. But if you need to build a new MSI with specific shortcut, I prefer to use Active Setup, more efficient. In short term, the way we find, is to use the AD to store the applications settings, then the VBS will query the AD to get settings and finally we put Active Setup for the next user login.


      The question is what is the answer / solution with LANDesk. Is there some way to do all or some of this tasks? I'm alone to want to use LANDesk in that way?


      Please, I'm waiting about you comment, remark, opinion or criticism

       

      Best Regards

      Lionel

        • 1. Re: User Centric Software Distribution - a Myth?
          Rookie

          Hi,

          The way I handle this scenario is to integrate a custom action into the msi that writes an entry in HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce to call the user based settings script at next log in. The main reason for doing this is you don't have to rely on AD for the script and it ensures that when a new user logs in the script will still run.

          • 2. Re: User Centric Software Distribution - a Myth?
            WiseGuy Apprentice

            The way we handle this is to create a script (in whatever form you want i.e. batch file, vbscript, etc) and include that in your base msi.  In the msi we also add the Active Setup registry keys that will run the script when the user logs in.  This allows us to push the msi package out to all the affected PCs and install it as SYSTEM.  The user specific settings are then applied by Active Setup when the user logs in.  The advantage of this is that it will apply to any user who logs in, whether they have a profile on the PC or not, and it requires only 1 LANDesk task.

            • 3. Re: User Centric Software Distribution - a Myth?
              Apprentice

              Yes it's a way we choose for the new users to have settings applied, via Active Setup. But we want also to have the software working for the current user without the need of a reboot. That's the reason of we add a user part of the package for the distribution...

               

              I know we want the cake and the butter ;-)) But any way we found, is it not the role of a software distribution solution to manage that?

              • 4. Re: User Centric Software Distribution - a Myth?
                Apprentice

                I do this using vbscript.  I have a function that checks the registry for every user that has ever logged in to the computer.  It then mounts the registry hives of each user and writes the required entry.  It then dismounts the hive and moves on.  I also will write to the default user hive so that any new users that log in to the computer will get the registry setting.  This works very well.  The only problem is that you have to build it in to your uninstall to undo all of this.  I'll post my function below in case anyone is interested in using it.  If you are going to be doing a lot of entries, I would modify the code to add a reg merge, since each user requires a 2 second wait period per run.  That means if you have 5 keys and 5 users, it will take you 50 seconds to run this.

                 

                 

                 

                Function RegWriteAllCurrentUsers(sRegKey, sRegValue, sRegType)
                    On Error Resume next
                    Const HKEY_USERS = &H80000003
                    Const HKEY_LOCAL_MACHINE = &H80000002
                    Set oFSO = CreateObject("Scripting.FileSystemObject")
                    Set oShell = WScript.CreateObject("WScript.Shell")
                    strUserProfile = oShell.ExpandEnvironmentStrings("%UserProfile%")
                    eProgramFiles = oShell.ExpandEnvironmentStrings("%ProgramFiles%")
                           
                    Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
                    strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
                    objReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
                   
                    For Each subkey In arrSubKeys
                        objReg.GetExpandedStringValue HKEY_LOCAL_MACHINE, strKeyPath & "\" & subkey, "ProfileImagePath", strProfileDir
                        if oFSO.FolderExists(strProfileDir & "\Desktop") or oFSO.FolderExists(strProfileDir & "\Escritorio") Then
                            If left(strProfileDir, 26) = "C:\Documents and Settings\" Or left(strProfileDir,8) = "C:\Users" Then
                                if right(strProfileDir, 12) <> "LocalService" Then
                                    if strProfileDir = strUserProfile Then
                                        'Current User Profile
                                        oShell.RegWrite "HKEY_CURRENT_USER\" & sRegKey, sRegValue, sRegType
                                    Else
                                        'Non-Logged in user profiles
                                        oShell.Run ("reg.exe load HKEY_USERS\CUSTOM """ & strProfileDir & "\NTuser.dat"""), 0, True
                                        wscript.sleep 1000
                                        oShell.RegWrite "HKEY_USERS\CUSTOM\" & sRegKey, sRegValue, sRegType
                                        If Err.Number <> 0 Then
                                            oShell.RegWrite "HKEY_USERS\" & subkey & "\" & sRegKey, sRegValue, sRegType
                                            Err.Clear                   
                                        End If
                                        wscript.sleep 1000
                                        oShell.Run ("REG.EXE unload HKEY_USERS\CUSTOM"), 0, True
                                    end If
                                end If
                            end If
                        end If
                    Next
                       
                    'Default User Profile
                    oShell.Run ("REG.EXE LOAD HKEY_USERS\CUSTOM ""%USERPROFILE%\..\Default User\NTUSER.DAT"""), 0, True
                    wscript.sleep 1000
                    oShell.RegWrite "HKEY_USERS\CUSTOM\" & sRegKey, sRegValue, sRegType
                    wscript.sleep 1000
                    oShell.Run ("REG.EXE UNLOAD HKEY_USERS\CUSTOM"), 0, True
                End Function