Automatic Application Update in Citrix Environment - c#

I have an application I Am developing that will be installed into a Citrix Server Farm environment where multiple Users will connect using Citrix XenApp. I want to incorporate ' into the application so that when a User runs up the application it will check for updates and prompt the User to update the application.
I have some uncertainties about this, specifically what considerations I need to make when installing my application on Citrix, e.g. If User A (and many other Users) is in the application and User B launches the application and gets prompted to update how will should this get handled if the application is installed in Program Files where it typically should be installed?
Should I install the application in Program Files and "shadow copy" to the User directory for execution?
Should I install the Application per user when each User first logs in?
Or are there other considerations to be made?
Hope someone has encountered this and can help

I would recommend to install the application per user when each user first logs in. In this way, when a user starts the app, it will update that user's copy and you will avoid file locks that will happen when a second user starts the app when it is being updated.

Related

C# main application was run as different user than logged in username, can I start a process from that application with that run as username?

Because the current windows logged in username doesn't have admin right on other computers, if I was to browse the C drive of another computer I have to put in the credential of the privilege account.
I have a application to perform different task on a computer, one of which is to open the C drive of the computer name in a combo box in explorer. I started the application using run as different user and use the privilege credential. But when I click to browse to C drive of the remote computer, it pops again asking for the credential with privilege.
How can I code the process start so that if I run the main application as the privilege account then process from it will also be run in that context? I don't want to have credential details in code but run the main app with it and utilize it for any process started by the application.
I know (and already tried) if I coded the privilege credential in the code then it would work. But I don't want to make change if the privilege is changed.
As I said above, how can I code the process start so that if I run the main application as the privilege account then process from it will also be run in that context?

C# Application (MSIX installation): Startup Task before User Login?

i have a question regarding auto-start an application:
I have a C# WPF Application, packaged as an MSIX installation.
And i successfully setup a StartUp Task via entry in the Manifest.
That works fine - after user logs in, the app is started automatically.
But as an additional feature we would need to be able to auto-run the app BEFORE user logs in.
After Windows startup, before user login.
Is there a way to do so?
I didn't find a solution until now...
Creating a scheduled task for example i found to be not possible, because i can only run a regular .exe file, but no installed application.
Thank you for help!
Best regards
Emanuel
An easy way for a application to start before the user logs in is to have a Windows Service for it.
If your application does not need any user interaction (and I am assuming it does not because you need it launched before the user logs in) that would be a viable option.
If your application does need user interaction in the Windows Login screen, you will need to do a google search on SysNotify but it is not for the faint hearted :)
Still no answer, so at least I´ll let you know a dirty workaround.
I figured that my msix app starts before login, when in Windows Personalization under LockScreen i set that the app should show status info´s on the lockscreen..... so it starts now in the users context, even before login.
under Application I already have the follwing, so the app can be selected to deliver lock screen content. (see 1. link below)
<uap:VisualElements
<uap:LockScreen Notification="badgeAndTileText" BadgeLogo="Images\BadgeLogo.png"/>
</uap:VisualElements>
https://learn.microsoft.com/de-de/previous-versions/windows/apps/hh700416(v=win.10)
Those are the documentation trails might leading to a better solution:
https://learn.microsoft.com/en-us/previous-versions/windows/apps/hh781238(v=win.10)?redirectedfrom=MSDN
https://learn.microsoft.com/de-de/previous-versions/windows/dn934782(v=win.10)

How can I create a windows application that should run with admin rights in .Net C# without prompting UAC again and again?

I am developing a windows application in .Net C#. The application is using some third party drivers which requires admin rights for it's execution. I know we can use app manifest and provide the required privilege there, but it prompts UAC everytime when user runs the application which is annoying for the user. So, Is there any other way so that we can run the application without prompting the user or it only prompts once and when user runs the application next time it should run with admin rights.
Thanks
This task can be delegated to a shortcut to an executable file in the properties of which the "Run as Administrator" flag is set.
Learn more about programmatic process privilege elevation here.
P. S. Applications that can run themselves as admin without asking administrator rights exists and are called rootkits, backdoors or trojans. Such programs are malicious. Writing them is a tricky and sometimes illegal.

How to get Application Running with admin permissions at user login and prevent user from killing it?

I have a C# application that is used to capture users screen, this application will be installed using an installer that requires administrator permissions. the application itself needs an active user session but doesn't display any UI elements of its own. My question how to make sure that the application is running whenever a user logs in? and how to make sure that no user (with no admin permission) can close the application?
The application should run on windows XP, 7, 8.
You can install the application so that it starts with every start of windows. You can use the registry for that or the (default user) startup folder.
An user without admin rights will not be able to kill an application that is not his, so if you start the application using i.e. the local system account, he won't be able to kill it. He will not even be able to see it, because the function "show processes from all users" in task manager is limited to users with admin permissions.
Disclaimer: Be aware that under certain legislations, it might be illegal to install such an application in a company network without the users knowing about it.
Use the Task Scheduler. It can launch apps at user logon with elevated privileges. Otherwise if it does not have to be a foreground App use a Windows service.

automatically login to windows after startup

a client of mine uses the task manager to trigger (start) a process to do something. This process contains a UI, and needs to be a single instance at all times (been taken care of).
Everything runs smoothly from the task manager, accept if you need to set the task manager settings to:”run whether user is logged on or not” (see the answer why this is a problem here: http://social.technet.microsoft.com/Forums/en-US/c03d6691-b058-4f8d-961c-e8eba25bbaed/task-scheduler-problem-run-whether-user-is-logged-on-or-not
Ok..no problem. We just let the task run only if the user is logged on. Still works fine (even with computer locked).
But, this night windows had an update and the system automatically rebooted. Logging of the user and therefor the task manager was not able to run the tasks. :-(
Since the program has a UI (is needed), I cannot switch to “run whether user is logged on or not”.
What would be best practice to:
logon again as the user that needs to run the application
make sure that the started application, is actually visible to the user, when he logs in? (unlockes the computer)
I know how to run processes with different user credentials in C#, but that’s not the solution for this problem.
Automatically logon a user (and lock the computer) when the computer has started, would be great.
Is this in any way possible? Or is there another solution for my problem?
Regards,
Matthijs
Create and install a Windows Service to do the actual work. This service will not require a logged on user and by definition only runs with once instance at a time, so this solves all of your problems.
Then let the UI communicate with the service through IPC and let the UI application start upon logon.
You can alternatively of course just let the user autologon, put a shortcut to the program in the startup folder and call the LockWorkStation() function after your application starts, but I would not take nor recommend that approach as it has security issues.
you can automatically login to a user account at startup with this :
http://technet.microsoft.com/en-us/magazine/ee872306.aspx
Click Start, type netplwiz, and then press Enter.
In the User Accounts dialog box, click the account you want to automatically log on to.If it is available, clear the Users Must Enter A User Name And Password To Use This Computer check box.
Click OK.
In the Automatically Log On dialog box, enter the user’s password twice and click OK.
The next time you restart the computer, it will automatically log on with the local user account you selected.
Automatic Windows logon as a predefined user is a convenient feature for single-user machines or home computers. This removes the hassle of unnecessary repetitive password entering in a secure environment and speeds up Windows startup and user profile warmup.
Howsoever, please do never forget that this is a kind of a security breach and should never be applied on computers, which could fall into hostile hands.
A detailed explanation of the procedure, without messing-up with the Windows registry, is available HERE.

Categories