Feb 23 2021 05:58 PM
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
Feb 23 2021 08:05 PM
@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.
Feb 23 2021 09:58 PM
@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
Feb 23 2021 10:09 PM
Solution
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
The Command Line to "Install" that file:
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.
Feb 24 2021 02:54 PM
@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!
Feb 23 2021 10:09 PM
Solution
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
The Command Line to "Install" that file:
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.