Automatic Updater with Access

1)Can we use Automatic Updater for VBA Access file?

2)At Present iam able to download updates from my server.

The way the update appears to work is that when an update is found it initiates the download and update. I want to change this tool to download it silently and an update notification(window) should appears when the update is fully downloaded. Could you please tell how can i change it?

3)Is there a way for wyBuild to restart the app when update is finsished if it is not an executable file(.accdr)?

1)Can we use Automatic Updater for VBA Access file?

No. The AutomaticUpdater is only for .NET apps. You can use wyUpdate as a standalone updater (which lets you do everything that the AutomaticUpdater can do, except you have to use commandline arguments instead of an API access).

2)At Present iam able to download updates from my server.

The way the update appears to work is that when an update is found it initiates the download and update. I want to change this tool to download it silently and an update notification(window) should appears when the update is fully downloaded. Could you please tell how can i change it?

You can't with wyUpdate as a standalone updater (you can, however, with the AutomaticUpdater). Or you can use wyUpdate in a Windows Service and have the Windows Service notify your VBA app that the download is complete.

3)Is there a way for wyBuild to restart the app when update is finsished if it is not an executable file(.accdr)?

Yes. Use a batch file to launch the accdr file however you open it (I presume by passing the file as an argument to Access) and execute that batch from wyUpdate after the update completes successfully.

Thanks for your responce. In my 3rd question the answer you said about batch file.So I tried running my application.exe using batch file when updates completed.Here it is working when i give exact path like C:\Programfiles\application.exe. But my requirement here is i need to give the path of program's folder where the user install it. So is there any options to run this application.exe using bacth file?

Pass the application name as commandline parameter when executing the batch file. See the "%basedir% variable" section of the executing files article.

I placed my bat file(to run application.exe) in Temporary folder but my all installation files are in Program's folder.Here i have used Command line switches: %basedir%\application.exe. even i could not run my application.exe after updating is complete?

Firstly, the commandline is not magic. You have to make use of the commandline arguments you pass to the batch file. So passing this:

"%basedir%app.exe"

Will expand in the batch file in the %1 variable as something like this:

"C:\Program Files\Your App\app.exe"

Notice how "%basedir%" has a trailing slash. That is, notice how I used this:

"%basedir%app.exe"

And not this:

"%basedir%\app.exe"

Wyatt iam sorry to disturb you again. Here if i pass exact path to batch file then its working fine even i placed it in temperory folder but here i need run app.exe from base directory because of end users have xp machines.. but if i pass "%basedir%app.exe" code to batch file then it could not run app.exe.

I placed bat file in Temporary folder in Files&Folders of wyBuild. My app.exe is in Programfiles.I need to run this app.exe after updates. So please help make it work. Thank you.

Try echoing out the %1 commandline argument in the batch file. That way you can see what is being passed in and if you did everything correctly.

Since you're executing an exe file, why don't you just execute it directly? Why are you bothering with a batch file?

Here iam using .accdr file for executing. So i took batch file run App.accdr file.

Hi Wyatt, Here i want to run my .accdr file after Update is complete Using VBA code. So can you please suggest me How can i use code after complete wyBuild update? In VBA access when can i use condition to run .accdr file.(How can we write code for this)? i want like this : If Update is complete then open file(start exe).

You said it worked when you hardcoded the paths, but not when you passed in a path. Which means you're not passing in the path correctly (or not using it correctly in the batch file). So, like I said before:

Try echoing out the %1 commandline argument in the batch file. That way you can see what is being passed in and if you did everything correctly.

Thanks wyatt, I Got it now when i use Not elevated option it is taking current directory and running .accdr file after finishing updates.

Could you please tell me how to change in User control account Publisher name and Product name for Windows 7 machines.?

When i click on Update then its giving User account control window contains Product Name:wyUpdate and Publisher: wyDay. So i want to change these two names.

Could you please tell me how to change in User control account Publisher name and Product name for Windows 7 machines.?

You'll have to recompile wyUpdate from source, then sign it with your own code signing certificate.

Hi Wyatt,Why my command is not working if i use like this in my VBA code : Shell AppPath & "\wyUpdate.exe / quickcheck "

The way the update appears to work is that when an update is found it initiates the download and update. Can we change this so that it downloads it silently then when the update is fully downloaded an update notification appears? Could you please give me details to Download it silently first then after with user aceptance it should start Updating.

Can we change this so that it downloads it silently then when the update is fully downloaded an update notification appears?

Not with VBA, sorry.

Why my command is not working if i use like this in my VBA code : Shell AppPath & "\wyUpdate.exe / quickcheck "

What do you mean by "not working". What happens? What is the expected result?

I dont want to see Downloading Update message on my window. It has to download silently then when update is fully downloaded an Update notification should appear. So i have used command: Shell AppPath & "\wyUpdate.exe / quickcheck " to get Update notifiation after Updaes downloading. But its not happening with this code now that iam seeing "Downloading update" message. This messge should not come.

As I described above, you can't hide the downloading / extracting steps unless you're using wyUpdate within a Windows Service or you're using the AutomaticUpdater.

With VBA your users will have to see the downloading window. There's no way around it. Of course you can brand the window with graphics, etc. so the user knows what's going on.

So, Here i have to use windows service for my project because my project is not developed with dotnet. Can you please tell me how can i create windows service???.. I tried with creating windows service using C#.Net but i could not get any update? i dont know how this window service is related to my project because i have just given GUID in code and attached Automatic updater in References. is it enough for updating process?Can you please give me details about this.

Am i in currect way to create windows service or is there any other way to create windows service?

We have an example Windows Service in the AutomaticUpdater source code.

Which GUID should i use in code either Application GUID or Wybuild GUID ? Because here this GUID only relate with wyUpdate it seems.

If you're using the AutomaticUpdaterBackend in a service then set the GUID to something like "yourcomanyname-yourproductname".

Iam using one drive to download updates for windows service application.While running windows service iam getting below error:Title: Unable to check for updates, the server file failed to load.Message: Error trying to save file: Error downloading: Access to the path is denied.

I gave exact path of .wyu file.

Where are you saving the file to? Do you have access to the file on your servers?

Iam saving the update files into a drive which is like a server. In this am able to create a folder, modify the folder and also delete the folder.I have access to the file with full control. But i dont know why i am still getting error Access to the path is denied.

If you're running wyUpdate from a Windows Service, you must make sure the service is running as "LocalSystem" and not as "LocalService". (Yes, there's a difference).

After you've done that, if you're still getting an error, tell me exactly at what step the error is occurring (when you're downloading, extracting, etc.). Also, copy & paste the exact error as it appears.

Iam running service as "LocalSystem" still iam getting error. This error occurs when service is running and here iam giving details

auBackend_BeforeCheckingauBackend_CheckingFailed. ReasonTitle: Unable to check for updates, the server file failed to load.Message: Error trying to save file: Error downloading "file://inaphyd1file01\US-IndiaFileTran$/DMT/Development/PTS Tools/Updates/wyServer.wys": Access to the path '\\inaphyd1file01\US-IndiaFileTran$\DMT\Development\PTS Tools\Updates\wyServer.wys' is denied.

First of all you're not forming the UNC path of your filename correctly. So first fix that. For example:

file://///servername/share/%file%

Next, after you've fixed the download site, if you're still getting the error, try copying & pasting that site into your browser. Do you get the same error? That's because you don't have access to the path. (In other words, wyupdate is telling you exactly what the problem is).

Still having Error downloading "file://inaphyd1file01/US-IndiaFileTran$/DMT/Development/PTS Tools/Updates/wyServer.wys": Access to the path '\\inaphyd1file01\US-IndiaFileTran$\DMT\Development\PTS Tools\Updates\wyServer.wys' is denied.

I tried changing code for Text file which will save at service run time. I have give text file path as server path.Then i got message "The Test AutoUpdate Service in C# service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs"

The UNC path is still not correct. Please google how to form a correct file:/// url using UNC paths.

I tried changing code for Text file which will save at service run time. I have give text file path as server path.

I don't know what that means. Please provide details about what you're doing, what you expect to happen, and what is actually happening (along with the entire error message).

Then i got message "The Test AutoUpdate Service in C# service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs"

Again, I don't know what that means. Please provide details about what you're doing, what you expect to happen, and what is actually happening (along with the entire error message).

Let me explain details about what iam trying to do. I have created window service using wyBuild Automatic updater source code to get the updates from server at boot. Now my requirement is updates should download from server to local machine(i keep updates manually in to server). So in this process after running windows when downloading updates connecting to server is problem. Here i dont have Username and password for server. Iam placeing .wys files and .wyu files in server. Below code using in window service.

auBackend = new AutomaticUpdaterBackend { GUID = "cbaae9eb-c4fc-4795-bef8-e1db9e3b6c08", UpdateType = UpdateType.Automatic, ServiceName = this.ServiceName };

Below method is using for creating text file in C drive. Here i have changed path to server. Then also having same Error trying to save file

using (StreamWriter outfile = new StreamWriter(@"C:\NETWinService.txt", append)) { outfile.WriteLine(message); }

Below method is using for creating text file in C drive. Here i have changed path to server. Then also having same Error trying to save file

Did you fix the UNC path? Do you have permission to access the file? Did you try the same exact file:/// url that the error showed in your browser? Do you get the same result in your browser as you do in wyUpdate?

I think i dont have problem with path because now iam able to get updates in windows7 machine. But coming to Xp machine i could not get the updates. The text file showing below message

auBackend_BeforeCheckingauBackend_CheckingFailed. ReasonTitle: wyUpdate exited prematurelyMessage: wyUpdate failed to start.

This is happening only in XP machines. So is there any thing to change code to work it in Xp also.

Are you including wyUpdate.exe along with your app? If not, then include wyUpdate.exe with your app and try again.

When you're using the AutomaticUpdater in your service, open the task manager. Do you see wyUpdate running? Does it open and close?

What happens when you just double click wyUpdate.exe?

I have included wyUpdate.exe in to my application. For windows 7 machine able to get updates.When coming to XP only having problem. In taskmanager i can see my service while running. But i could not see wyBild application in Task manager.When i double click on wyUpdate.exe started downloading updates and installed fine.

So i found only with service iam not able to get updates in XP machine.

But i could not see wyBild application in Task manager.

What about wyUpdate? In the task manager sort the processes by name, then scroll to the bottom of the list. Then start your service. Do you see wyUpdate briefly start? Does it ever start?

No Wyupdate in my taskmanager processes.Can windows service show wyUpdate in Processes?. Because in Windows7 iam able to get updates. There in window7 also i could not see wyupdate in Processes but its downloading the updates. The problem is with Windows XP only.

This Error is only for windowsXP machines:

Message: Error trying to save file: Error downloading "https://theshare.thomsonreuters.com/sites/trta/sites/pts/Outsourcing/DMT/sotware_updates/ptstools/updates/wyServer.wys": The remote server returned an error: (401) Unauthorized.

So how can we change authorization to my server to access files?

I can run wyUpdate and able to install manually. But coming windows service only having problem?

There in window7 also i could not see wyupdate in Processes but its downloading the updates.

Make sure your Task Manager is set to show processes of all users. (Click the checkbox "Show processes from all users")

Message: Error trying to save file: Error downloading "https://theshare.thomsonreuters.com/sites/trta/sites/pts/Outsourcing/DMT/sotware_updates/ptstools/updates/wyServer.wys": The remote server returned an error: (401) Unauthorized.

So how can we change authorization to my server to access files?

This depends on your server. Ask your IT administrator why you can't access the file. This isn't a problem with wyUpdate. This is a problem with your network.

"Make sure your Task Manager is set to show processes of all users. (Click the checkbox "Show processes from all users")"

Now i can see my windows service in Taskmanager.

Here access file with windows7 is different with XP? Evern user have access permissions for folder in server also could not get updates. Log file in C drive is created.

Do you have any idea about permission level for share point user to get updates?

I really don't know what you're talking about. If you're getting an error copy & paste the full error.

If your service is running as LocalSystem then wyUpdate should have full permission to the machine that's being updated (unless you do crazy things with system permissions).

Pts Tools Update informationauBackend_BeforeCheckingauBackend_CheckingFailed. ReasonTitle: Unable to check for updates, the server file failed to load.Message: Error trying to save file: Error downloading "https://theshare.thomsonreuters.com/sites/trta/sites/pts/Outsourcing/DMT/sotware_updates/ptstools/updates/wyServer.wys": The remote server returned an error: (401) Unauthorized.

This is the error iam getting when i run windows service. Iam using Target framework is .Net Framework2.0

Again, this is a problem with your network. wyUpdate is telling you exactly what's wrong. You don't have access to the file. Copy & paste the file URL from that error into your browser, and your browser will give you the exact same error.

Configure your server correctly so that you *do* have access to the file.

Thanks for your reply.. I tried with changing folder permission level to full control.Then also have same issue.I really dont understant where it is blocking.

This is a problem with your web server. Ask whoever set up the server.

I have copied my server path where it is using to download the updates and pasted the same path in browser then i am able download the update file and if i run wyUpdate.exe by double click then also i am able to download the updates. So using wybuild source code can we change those permissions?

Ok, it sounds like your HTTP servers are doing something screwy like checking the local Windows username. Or perhaps you have a proxy configured on the system for your logged in users, but you forgot to set the proxy for the "LocalSystem" user account.

You can always manually pass the proxy to wyUpdate.

Can i use below command in C# code.If yes where can i use it ?could you please tell me.

automaticUpdater.wyUpdateCommandline = "-proxy:\"http://proxyserver:80/\"";

I'm not sure I understand. It's exactly as easy as it looks. Put the code in your Windows service with all the other AutomaticUpdater code. Also, change the proxy server to whatever you use at your company.

For example, if you're using our WindowsService example using the AutomaticUpdaterBackend, then simply change that code snippet to this:

auBackend.wyUpdateCommandline = "-proxy:\"http://proxyserver:80/\"";

And put that in the OnStart() method.