We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

bchetana
Posts: 95
Joined: Sat Dec 01, 2012 11:36 am

Call Updater in non admin user

Hi ,

We are calling updater programatically, We are reading updates avilable or not by using retun code (0)
But for restrited user, its giving 5. So vat are all the retun codes to find out updates avilable ?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Call Updater in non admin user

Hi,

You can find the updater return codes in the Auto Updater article.

If you want to be able to run the updater in a non-administrator user you can follow our How to handle updates without elevation tutorial.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bchetana
Posts: 95
Joined: Sat Dec 01, 2012 11:36 am

Re: Call Updater in non admin user

hi

Please see the below code

string _updaterPath = objGlobalData.ObjSWServiceDirectory.GetInstallLocationFilePath(PlanningConsoleConstants.UPDATE);
Debug.WriteLine("_updaterPath :" + _updaterPath);
Process updateProcess = Process.Start(_updaterPath, PlanningConsoleConstants.UPDATE_JUSTCHECK);
updateProcess.WaitForExit();
int resultCode = updateProcess.ExitCode;


Debug.WriteLine("Result Code is : " + resultCode.ToString());
if (resultCode == 0)
{
//updates avilable
Process updaterDownloadProcess = Process.Start(objGlobalData.ObjSWServiceDirectory.GetInstallLocationFilePath(PlanningConsoleConstants.UPDATE), PlanningConsoleConstants.UPDATE_JUSTDOWNLOAD);
updaterDownloadProcess.WaitForExit();


Thread thread = new Thread(NotifyUpdates);
thread.SetApartmentState(ApartmentState.STA); //Set the thread to STA
thread.Start();

}

The problem is the resultcode for non admin is returning 5. So can you conform the same? For Non admin user the result code 5 means the updates are avilable?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Call Updater in non admin user

Hi,
The problem is the resultcode for non admin is returning 5
UNABLE_TO_SAVE_FILE (0xE0000005) - The updater is unable to save a file.
For Non admin user the result code 5 means the updates are avilable?
No.

When the updater checks for updates it tries to save the updates in the [AppDataFolder][Manufacturer]\[ProductName]\updates\ (this is the default location) as you can see in the Updater page, "Downloads updates in this folder" text field. But because the user is not an administrator, the updater can't use the [AppDataFolder] folder. In this case you can use the [CommonAppDataFolder] folder instead.

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bchetana
Posts: 95
Joined: Sat Dec 01, 2012 11:36 am

Re: Call Updater in non admin user

So, if we use [CommonAppDataFolder] in updater page, it will work for restricted user?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Call Updater in non admin user

Hi,

Yes, it should work.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bchetana
Posts: 95
Joined: Sat Dec 01, 2012 11:36 am

Re: Call Updater in non admin user

ThnQ...

One more clarification,

I am using "Uninstall Previous version" custom action at the time of upgrade. So when we install upgrades, it is first uninstalls the old version and then installs the upgrades.
So at the time of upgrades installation, if the user clinks on cancel it is cancelled and old product is also uninstalled. At this time I want to rollback the upgrade. How can I handle this?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Call Updater in non admin user

Hi,

Unfortunately you can't rollback an uninstalled product, but you can simply go in the Upgrades page and check the "Install new version first and then uninstall old version" option.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bchetana
Posts: 95
Joined: Sat Dec 01, 2012 11:36 am

Re: Call Updater in non admin user

ok,

MY Installer contains activeX and Com object, so we were uninstalling the old product and installing the new. So we dont face any issue we if go in this path?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Call Updater in non admin user

Hello,

You shouldn't, as long as you will as you will follow the Windows Installer Upgrades rules.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”