Call Updates from a windows service

Got a problem you cannot solve? Try here.
ravz
Posts: 48
Joined: Wed Jan 19, 2011 9:39 pm

Call Updates from a windows service

Postby ravz » Mon Mar 21, 2011 10:02 pm

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

giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Call Updates from a windows service

Postby giaviv » Tue Mar 22, 2011 3:37 am

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!
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

ravz
Posts: 48
Joined: Wed Jan 19, 2011 9:39 pm

Re: Call Updates from a windows service

Postby ravz » Tue Mar 22, 2011 4:16 pm

Thank you for your quick and very helpful answer.

giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Call Updates from a windows service

Postby giaviv » Wed Mar 23, 2011 10:06 am

Sure!
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Call Updates from a windows service

Postby giaviv » Fri Apr 01, 2011 7:21 am

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.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

yjdev
Posts: 6
Joined: Wed Apr 06, 2011 7:03 pm

Re: Call Updates from a windows service

Postby yjdev » Wed May 18, 2011 7:26 pm

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.

giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Call Updates from a windows service

Postby giaviv » Thu May 19, 2011 7:38 am

please see my response to you on the other thread :)
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 31 guests