SCCM 2012 Proof %appdata%

Hello,

i wnat to copy some settings to the current logged user within an application package. The proofing should check if the file is store under %appdata% folder of the users.

I added this as check in Apllication but it failes

December 5th, 2013 5:49pm

%appdata% is resolved to C:\Windows\system32\config\systemprofile\AppData\Roaming in system context, but C:\Users\<username>\AppData\Roaming for a user.  This might cause the problem.
Free Windows Admin Tool Kit Click here and download it now
December 5th, 2013 6:06pm

You can use a scrip insted. Something like this:

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = WScript.CreateObject("WScript.Shell")

If oFSO.FileExists(oShell.ExpandEnvironmentStrings("%AppData%\Roaming\Test\MyApp.txt")) Then
   
WScript.StdOut.Write "The application is installed"
   
WScript.Quit(0)
Else
   
WScript.Quit(0)
End If


  • Edited by dekac99 Thursday, December 05, 2013 3:20 PM
December 5th, 2013 6:20pm

Torsten's point is that if you are deploying the App as "Install for System", %appdata% doesn't point to what you think it does. Using a script doesn't change this.
Free Windows Admin Tool Kit Click here and download it now
December 5th, 2013 8:49pm

Hello Jason, hello Torsten,

i am deploying the files for User "Install for user".

The path for detection is resolving corectly when i put into Run field of Windows:

I tested:

1. C:\Users\%username%\AppData\Roaming\XMind\workspace-cathy\.metadata\.plugins\org.eclipse.core.runtime\.settingss

2. %AppData%\Roaming\XMind\workspace-cathy\.metadata\.plugins\org.eclipse.core.runtime\.settings

As far as i understand, when i install (or in this case copy) a file with the "Install for user" option it should use the current logged users folders and not the system folders for installing for device.

BTW the copy job is working with this settings.

December 6th, 2013 8:58am

Do AppEnforce / AppDiscovery.log tell that the application was installed successfully, but the detection failed?
Free Windows Admin Tool Kit Click here and download it now
December 6th, 2013 11:12am

Hello Torsten,

the AppEnforce.log  closed with the exit code 0. So I think its OK.

here is the AppEnforce.log

+++ Starting Install enforcement for App DT "Install" ApplicationDeliveryType - ScopeId_E61E93EC-58A1-4297-ACC0-9C9833A789BF/DeploymentType_6856ea9e-feee-4ea2-b5c8-066fed001bdf, Revision - 4, ContentPath - C:\Windows\ccmcache\p, Execution Context - User AppEnforce 06.12.2013 12:02:27 1556 (0x0614)
    A user is logged on to the system. AppEnforce 06.12.2013 12:02:27 1556 (0x0614)
    Performing detection of app deployment type Install(ScopeId_E61E93EC-58A1-4297-ACC0-9C9833A789BF/DeploymentType_6856ea9e-feee-4ea2-b5c8-066fed001bdf, revision 4) for user. AppEnforce 06.12.2013 12:02:27 1556 (0x0614)
+++ Application not discovered. [AppDT Id: ScopeId_E61E93EC-58A1-4297-ACC0-9C9833A789BF/DeploymentType_6856ea9e-feee-4ea2-b5c8-066fed001bdf, Revision: 4] AppEnforce 06.12.2013 12:02:27 1556 (0x0614)
    App enforcement environment:
 Context: User
 Command line: "Install.cmd"
 Allow user interaction: Yes
 UI mode: 0
 User token: not null
 Session Id: 1
 Content path: C:\Windows\ccmcache\p
 Working directory:  AppEnforce 06.12.2013 12:02:27 1556 (0x0614)
    Prepared working directory: C:\Windows\ccmcache\p AppEnforce 06.12.2013 12:02:27 1556 (0x0614)
    Prepared command line: "C:\Windows\ccmcache\p\Install.cmd" AppEnforce 06.12.2013 12:02:27 1556 (0x0614)
    Executing Command line: "C:\Windows\ccmcache\p\Install.cmd" with user context AppEnforce 06.12.2013 12:02:27 1556 (0x0614)
    Working directory C:\Windows\ccmcache\p AppEnforce 06.12.2013 12:02:27 1556 (0x0614)
    Post install behavior is BasedOnExitCode AppEnforce 06.12.2013 12:02:27 1556 (0x0614)
    Waiting for process 2388 to finish.  Timeout = 15 minutes. AppEnforce 06.12.2013 12:02:27 1556 (0x0614)
    Process 2388 terminated with exitcode: 0 AppEnforce 06.12.2013 12:02:28 1556 (0x0614)
    Looking for exit code 0 in exit codes table... AppEnforce 06.12.2013 12:02:28 1556 (0x0614)
    Matched exit code 0 to a Success entry in exit codes table. AppEnforce 06.12.2013 12:02:28 1556 (0x0614)
    Performing detection of app deployment type Install(ScopeId_E61E93EC-58A1-4297-ACC0-9C9833A789BF/DeploymentType_6856ea9e-feee-4ea2-b5c8-066fed001bdf, revision 4) for user. AppEnforce 06.12.2013 12:02:28 1556 (0x0614)
+++ Application not discovered. [AppDT Id: ScopeId_E61E93EC-58A1-4297-ACC0-9C9833A789BF/DeploymentType_6856ea9e-feee-4ea2-b5c8-066fed001bdf, Revision: 4] AppEnforce 06.12.2013 12:02:28 1556 (0x0614)
++++++ App enforcement completed (0 seconds) for App DT "Install" [ScopeId_E61E93EC-58A1-4297-ACC0-9C9833A789BF/DeploymentType_6856ea9e-feee-4ea2-b5c8-066fed001bdf], Revision: 4, User SID: S-1-5-21-1961321678-1726313733-410060929-897942] ++++++ AppEnforce 06.12.2013 12:02:28 1556 (0x0614)

and here the AppDiscovery.log

+++ Did not detect app deployment type Install(ScopeId_E61E93EC-58A1-4297-ACC0-9C9833A789BF/DeploymentType_6856ea9e-feee-4ea2-b5c8-066fed001bdf, revision 4) for S-1-5-21-1961321678-1726313733-410060929-897942. AppDiscovery 06.12.2013 12:02:24 1556 (0x0614)
   ActionType - Install will use Content Id: Content_8feb9ca3-fe79-49d7-af52-43395fee4d58 + Content Version: 1 for AppDT "Install" [ScopeId_E61E93EC-58A1-4297-ACC0-9C9833A789BF/DeploymentType_6856ea9e-feee-4ea2-b5c8-066fed001bdf], Revision - 4 AppDiscovery 06.12.2013 12:02:26 1556 (0x0614)
   ActionType - Install will use Content Id: Content_8feb9ca3-fe79-49d7-af52-43395fee4d58 + Content Version: 1 for AppDT "Install" [ScopeId_E61E93EC-58A1-4297-ACC0-9C9833A789BF/DeploymentType_6856ea9e-feee-4ea2-b5c8-066fed001bdf], Revision - 4 AppDiscovery 06.12.2013 12:02:26 1556 (0x0614)

December 6th, 2013 2:08pm

AppEnforce and AppDiscovery are two different things. AppEnforce reflects the actual installation and has nothing to do with the detection rules.

So, assuming that your detection rule is correct and actually exists, it's possible that this is a timing issue. Discovery rules for detection of the app run immediately at the exit of the process launched by the deployment type. It's possible -- and happens on occasion with different installers -- that the process launched spawns other processes that are still running and performing their work when the initial process exits so that whatever is detected by the detection rules is not actually in place when the detection rule is evaluated during discovery but by the time you go check it is. The only way to address this is to wrap the processes being launched by the deployment type in a script and add a delay at the end to wait for the spawned processes to finish. Given that you are already using a script, you can simply add a delay to it and try again.

Without knowing anything about your script though or what it spawns, this is all a bit of guess work.

Free Windows Admin Tool Kit Click here and download it now
December 6th, 2013 6:54pm

Did you ever get this resolved?  I'm trying to detect in the user's AppData as well and the installation seems to run okay but the detection happens as the local system.  I included a line in my VBscript detection that writes the %appdata% variable to a file and it puts out C:\WINDOWS\system32\config\systemprofile\AppData\Roaming when the application is set to "Install for User".
February 24th, 2014 8:16pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics