Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Deploy MDE's on servers

Posted on 2010-11-17
10
Medium Priority
?
362 Views
Last Modified: 2012-05-10
CURRENT SITUATION: Currently we have access Front ends with a combination of SQL/Access backends. When a employee needs access to an application we have a script we run that install it (Access MDE Front-end), a desktop shortcut and 2 TXT files (one with the app name and the other the app name with version number. The user can now access the application.

Weeks later and update is done. The new MDE is placed in a certain location on the server and when the user logs in it checks for the 2 TXT files and (1) if they have the app goes to step (2) checks the version number. If it's the same it does nothing; otherwise it copies the new MDE to their hard drive.

MOVING TO: We are going virtual thus users will not have a C drive. What I have come up with is s structure similar to a HOME drive. Where each user will have a folder and inside it contains the MDE. We are starting to use Citrix XenApp so I have published shortcut that will run the app where I tell it to for each user.

PROBLEM: now my problem is updating. Since we use WYSE Thin Clients the user does not actually login to the "system" till they launch an app. I can get the login script to run and replace files but if the APP is a database that needs replacement and is open it will not over write.

WHAT I WOULD LIKE TO: Is create a script that would parse through all users directories and look for an MDE Name (for example HR.MDE) if it exists copy the file to that users folder and replace it.

I figure I could scheedule to deployment batch file to run during the night say at 2 am. Since it would run through all users folders and replace the file it would only need to be run once.

MY MAIN ISSUE: What is the code to reda from a folder say called D:\UserAPPs. They go into each folder, check for that MDE and if exist replace it. It not exist or when done with that user go to the next folder till it went through all the users folders.

Wish I could 1000 ponts on this. Please Help. Any/All suggetsions will be apprciated.
0
Comment
Question by:ccowan159
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
10 Comments
 
LVL 85
ID: 34157010
You could do this:

Build a Batch file that copies the FE from a specific location to one that is common to all users (for exampled: Home\Users]<UserName), then launch that file. I've done this on a XenApps setup and it works pretty well. Each time the user launches the app (or in your case, fires off the app) they get a new copy of the FE and that new copy is launched.
0
 

Author Comment

by:ccowan159
ID: 34157182
What I  hope to do is not have each user run it every time they login.

I hope I could put the batch (deployment file) on the server. Then when we update the app we schedule it for night time.

It would then read the USERAPP directory and look in each users folder and if the app is found replace it. If not continue on till done.

It would be easy for use to use windows scheduler to say set app 1 at 2 am, app 2 at 3 am. Of course we would set it to run only once since it would replace all files as needed.

Could you give me a sample of the batch file you use?

Any idea how I can do this
0
 
LVL 85
ID: 34158181
My batch file doesn't do anything more than copy a file from LocationA to LocationB, and then launch the new file at LocationB. It doesn't involve looping, directory searches, etc. YOu can probably do that with batch scripting, but I'm no expert i that area.

It seems to my your goal is to move a fresh copy of a database to a user's working directory. This is as simple as a Copy statement, but I'm not sure what the directory searching is needed for. Can you provide more details?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:ccowan159
ID: 34158189
Basically you are right it is a fresh copy. My main is is the looping through the directories and then check for the file. If exist replace; if not continue to the next users folder till all done
0
 
LVL 85
ID: 34158245
I'm not sure how to do this with batch scripting. You might ask the Moderators to include the Scripting Zones in this question.
0
 
LVL 17

Accepted Solution

by:
JezWalters earned 2000 total points
ID: 34162753
There are lots of different language choices for scripting what you're after but since you're already using VBA, why not use VBScript?  Make sense to me!  ;-)

If I've understood you correctly, you can achieve what you're after like this:
Option Explicit  ' Force explicit variable declaration

' Declare constants
Const USER_APPS = "D:\UserAPPs"            ' User applicatons folder
Const NEW_APP = "C:\Temp\Test\NewApp.mde"  ' New applicaton

' Declare variables
Dim fldApplication       ' Applications folder
Dim fldUser              ' User folder
Dim fsoFileSystemObject  ' File system object
Dim strUserApp           ' User application

' Process user applications folders
Set fsoFileSystemObject = CreateObject("Scripting.FileSystemObject")
Set fldApplication = fsoFileSystemObject.GetFolder(USER_APPS)
For Each fldUser In fldApplication.SubFolders

    ' Replace application, if it exists
    strUserApp = fldUser & "\" & Mid(NEW_APP, InStrRev(NEW_APP, "\") + 1)
    If fsoFileSystemObject.FileExists(strUserApp) Then
        fsoFileSystemObject.CopyFile NEW_APP, strUserApp
    End If
    Set fldUser = Nothing
Next
Set fldApplication = Nothing
Set fsoFileSystemObject = Nothing

Open in new window

0
 
LVL 17

Expert Comment

by:JezWalters
ID: 34162766
You'll need to change the NEW_APP constant to be the path to your new MDE application, and then save the above as a text file with the extension '.vbs'.

It'd be worth adding some error handling too - let me know if you'd like some help with this!
0
 

Author Closing Comment

by:ccowan159
ID: 34187782
The VB solution is the best one. I used this code with some other code and was able to get the application to deply as needed without any users help
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question