SOLVED

How to deploy a .xml as part of a Available Application install?

%3CLINGO-SUB%20id%3D%22lingo-sub-2161234%22%20slang%3D%22en-US%22%3EHow%20to%20deploy%20a%20.xml%20as%20part%20of%20a%20Available%20Application%20install%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2161234%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Tech%20Community%2C%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20create%20an%20application%20to%20be%20available%20in%20Software%20Centre.%26nbsp%3B%20%26nbsp%3BI%20have%20created%20the%20application%20in%20config%20manager%20and%20have%20made%20it%20an%20Available%20deployment%20to%20my%20user%20base.%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20application%20displays%20in%20Software%20Centre%20%26amp%3B%20installs%2Funinstalls%20correctly%20however%20as%20part%20of%20the%20install%20I%20need%20to%20copy%20a%20.xml%20from%20a%20network%20location%20to%20the%20local%20computer.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20not%20sure%20on%20how%20to%20achieve%20this.%26nbsp%3B%20My%20first%20though%20was%20to%20create%20a%20Task%20Sequence%20however%20it%20doesn't%20let%20me%20create%20a%20deployment%20for%20Users%20only%20Devices.%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20help%2FSuggestions%20would%20be%20greatly%20appreciated%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2161234%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EApplication%20deployment%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ECM%20current%20branch%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2161450%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20deploy%20a%20.xml%20as%20part%20of%20a%20Available%20Application%20install%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2161450%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F976767%22%20target%3D%22_blank%22%3E%40Chris_Coates%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3ECoping%20files%20from%20a%20network%20location%20is%20always%20a%20bit%20tricky.%26nbsp%3B%20I'd%20recommend%20placing%20the%20XML%20file%20in%20your%20content%20source%2C%20so%20it's%20part%20of%20the%20content%20being%20downloaded%20into%20the%20cache%2C%20then%20copying%20it%20from%20there%20into%20the%20proper%20location.%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20the%20XML%20file%20is%20something%20that%20is%20updated%20regularly%2C%20you%20could%20create%20a%20very%20simple%20application%20that%20only%20contains%20that%20XML%20file.%26nbsp%3B%20Install%20Command%20%3D%20cmd.exe%20%2Fc%20File.XML%20c%3A%5CPlace%5CFile.XML%20%2Fy%26nbsp%3B%26nbsp%3B%3CBR%20%2F%3Eor%20something%20simple%20like%20that.%3CBR%20%2F%3EDetection%20Method%20%3D%20File%20c%3A%5CPlace%5CFile.XML%20exist.%3CBR%20%2F%3E%3CBR%20%2F%3Enow%2C%20if%20that%20XML%20file%20is%20updated%20regularly%2C%20you%20could%20easily%20script%20updating%20the%20application%20daily%20or%20weekly.%26nbsp%3B%26nbsp%3B%3CBR%20%2F%3EPowerShell%20Script%20would%20compare%20the%20XML%20file%20on%20the%20network%20share%20your%20CM%20Application%20Source%20Location%2C%20and%20if%20newer%2C%20replace%20the%20CM%20App%20Source%20XML%20file%2C%20then%20update%20your%20Application%20detection%20method%20with%20the%20new%20last%20date%20modified.%3CBR%20%2F%3E%3CBR%20%2F%3EOR..%20if%20you're%20still%20wanting%20to%20have%20the%20application%20copy%20it%20directly%20from%20the%20network%2C%20if%20you%20add%20%22Domain%20Computers%22%20to%20have%20Read%20rights%20to%20that%20Share%20and%20XML%20file%20location%2C%20it%20should%20be%20able%20to%20copy%20it.%26nbsp%3B%20You%20just%20have%20to%20make%20sure%20that%20the%20machine%20is%20always%20on%20the%20network%20when%20the%20install%20is%20happening.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi Tech Community,   

 

I am trying to create an application to be available in Software Centre.   I have created the application in config manager and have made it an Available deployment to my user base.     

 

The application displays in Software Centre & installs/uninstalls correctly however as part of the install I need to copy a .xml from a network location to the local computer. 

 

I am not sure on how to achieve this.  My first though was to create a Task Sequence however it doesn't let me create a deployment for Users only Devices.    

 

Any help/Suggestions would be greatly appreciated

4 Replies

@Chris_Coates 

Coping files from a network location is always a bit tricky.  I'd recommend placing the XML file in your content source, so it's part of the content being downloaded into the cache, then copying it from there into the proper location.

If the XML file is something that is updated regularly, you could create a very simple application that only contains that XML file.  Install Command = cmd.exe /c File.XML c:\Place\File.XML /y  
or something simple like that.
Detection Method = File c:\Place\File.XML exist.

now, if that XML file is updated regularly, you could easily script updating the application daily or weekly.  
PowerShell Script would compare the XML file on the network share your CM Application Source Location, and if newer, replace the CM App Source XML file, then update your Application detection method with the new last date modified.

OR.. if you're still wanting to have the application copy it directly from the network, if you add "Domain Computers" to have Read rights to that Share and XML file location, it should be able to copy it.  You just have to make sure that the machine is always on the network when the install is happening.


@gwblok thankyou for getting back to me so quickly.    I tried the cmd line you provided however couldnt get it working.      I have a feeling it may be that i need to copy the file into C:\ProgramData\VendorName

 

So i tried this (didnt have any luck but tried it anyway)

 

1.   Created .bat with the following code  (works like a charm when i run it manually)

IF EXIST "C:\ProgramData\Trebuchet\" (
xcopy "\\domain\Techtools\Installs\Applications\Cherwell\Connection Config Files\PROD\" "C:\ProgramData\Trebuchet\" /q
) ELSE (
mkdir xcopy "C:\ProgramData\Trebuchet"
xcopy "\\domain\Techtools\Installs\Applications\Cherwell\Connection Config Files\PROD\" "C:\ProgramData\Trebuchet\" /q
)

 

2. Created Application in ECM by manually specifying the application info 

3. Created Deployment Type - Script Installer

4. Set content Location \\domain\Techtools\Installs\Applications\Cherwell\Connection Config Files\PROD\

5. Persist Content in client cache

6. Installation Program

cmd.exe /c start "\\domain\Techtools\Installs\Applications\Cherwell\Connection Config Files\PROD\ProdConnect.bat"

7. Set Detection Rule to File

8. Path Set to C:\ProgramData\Trebuchet

9. File Set to Connections.xml

10 Deployed as available to Users group.

 

Anything you can see that i could do to fix this?

 

Cheers

 

 

 

 

 

Best Response confirmed by Chris_Coates (New Contributor)
Solution

@Chris_Coates 

 

Your Application Command line should just be: ProdConnect.bat

If you set your Application Content location to: \\domain\Techtools\Installs\Applications\Cherwell\Connection Config Files\PROD


When you trigger the Application, it downloads the Application Content (Everything in that PROD folder) to the CCMCache, then triggers the batch file from there, so the other files are relative. 

Example, I have a folder CMTrace with a file in it
gwblok_0-1614146811356.png

The Command Line to "Install" that file:

gwblok_1-1614146875812.png


If you set your Content to the network location, then distributed it to your DPs, you would set your install program to a file in that folder.

Once you've set your content path, you could just click on the "Browse" for Installation Program, and choose your Batch File.



@gwblok thankyou for your help on this.   I have it working now.

I still had some issues with the folder structure not being present so in the end still had to use the .bat to check if it existed.    

 

But have it copying in successfully!  I call that a Win!