Page 1 of 1

Call Updates from a windows service

Posted: Mon Mar 21, 2011 10:02 pm
by ravz
Hi Guys

We are using a windows service, so I would like to call the manual update programmatically in this service.
To achieve this, I need to know the path of my installer-file.

By having a look at the update-shortcut, the installer-file is called like this:
"C:\Documents and Settings\All Users\Application Data\GUID\EVA.exe" /update
This is raising the following questions:
- How can I get the GUID for the path?
- Can I pass an argument to the installer-file so that it is updating without any user interaction?

Thank you.

Regards,
ravz

Re: Call Updates from a windows service

Posted: Tue Mar 22, 2011 3:37 am
by giaviv
Dear ravz,

You can find the GUID (or the UninstallString) at the registry value: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{productcode}\UninstallString (or HKLM\SOFTWARE\Wow6432\Microsoft\Windows\CurrentVersion\Uninstall\{productcode}\UninstallString on 64bit machines). The UninstallString will point to to the exe to which you can call with the update flag.
To run a silent (no user interaction) update, run setup.exe /update /s.

I hope this helps!

Re: Call Updates from a windows service

Posted: Tue Mar 22, 2011 4:16 pm
by ravz
Thank you for your quick and very helpful answer.

Re: Call Updates from a windows service

Posted: Wed Mar 23, 2011 10:06 am
by giaviv
Sure!

Re: Call Updates from a windows service

Posted: Fri Apr 01, 2011 7:21 am
by giaviv
Dear ravz,

Please note that in order to prevent mistakes of reading the wrong location, you can write the $UNINSTALLLINK$ to the registry, a text/INI file and so forth in your setup, and then read it in your Windows service.

Re: Call Updates from a windows service

Posted: Wed May 18, 2011 7:26 pm
by yjdev
I wonder if anyone can help. I am trying to run a silent update as well from a Windows Service.

When I tried it in the command prompt, it worked with using /update /s switch. However when I tried inside Windows Service using .Net Process I get this error in Event Viewer:

Error 1312. Cannot create the directory 'C:\Windows\TEMP\miaCBA5.tmp\xxx.exe'. A file with this name already exists. Please rename or remove the file and click retry, or click Cancel to exit.

This error only occurs when I am trying to run it from Windows Service. When I try to run from a command prompt it does not give this error. I notice that the user is SYSTEM when this error occurs. When I try running it in command prompt the user is normal user. Also, the temporary directory that stores the installation files is 'C:\Users\userXXX\AppData\Local\Temp\mia18\' rather than 'C:\Windows\TEMP\mia...\'.

Why is it giving this error when running under SYSTEM? I tried deleting all files and folders in C:\Windows\Temp\ before running the silent update and the same error happened as well.

Re: Call Updates from a windows service

Posted: Thu May 19, 2011 7:38 am
by giaviv
please see my response to you on the other thread :)