Jump to content


regan

Copy Files During Application Install

Recommended Posts

I have created an application which contains multiple installs which all work well however I have added a bat file at the end which copies a couple of INI files to a directory. The bat file seems to work fine but during the install it doesn’t. I may be going about it the wrong way so any advice would be welcome.

The bat file is

 

del "C:\WINDOWS\sims.ini"

if not exist "c:\program files\sims\sims .net\connect.ini" copy /y "\\MySccmserver\Sources\OS Deployment Share\Shortcuts\Sims Connect ini\connect.ini" "c:\program file\sims\sims .net"

if not exist "C:\WINDOWS\sims.ini" copy /y "\\ MySccmserver \Sources\OS Deployment Share\Shortcuts\Sims Ini\sims.ini" "C:\WINDOWS\"

post-24873-0-63987500-1452690471.jpg

Share this post


Link to post
Share on other sites

Assuming the programs run under system context? User will not have permission to C;\windows. Does \\mysccmserver file share give every machine account permission to the files?

 

You could just put a copy of connect.ini & sims.ini in the application content source. Then you would just need to change the bat file to (this way the ini files will just be in the working directory) :

 

del "C:\WINDOWS\sims.ini"

if not exist "c:\program files\sims\sims .net\connect.ini" copy /y "connect.ini" "c:\program files (x86)\sims\"

if not exist "C:\WINDOWS\sims.ini" copy /y "sims.ini" "C:\WINDOWS\"

Share this post


Link to post
Share on other sites

I think the issues is access to the C:\WINDOWS folder as i have to run as administrator in order to work. During a TS i can just create a package and use xcopy which works but im trying to build it into the application

Share this post


Link to post
Share on other sites

Is there a specific reason not to put the files into your package sources?

No there's not, i can do that, how would i reference that in the bat file though?

if not exist "C:\Program Files\SIMS\SIMS.Net\connect.ini" copy /y "\\%~dp\Sims Connect ini" "C:\Program Files\SIMS\SIMS.Net"

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.