Wpf application doesn't start at startup - wpf

I have developed a wpf app and want it to run whenever the computer starts up.However I have been unable to do so......I have tried editing registry like this answer...
Launch Window on Windows startup
Interesting thing is the app does autostart when there is internet connection.It doesn't when there is no internet. I do need internet connection at some point of time to sync the data to internet application. However this should not have affected the startup of the application.
Any ideas???

I guess you can set up a timer, and after several minutes, check out your internet, if the internet is ok, then run your application continuely. If not, reset the timer, and check again.

Go to the run line (Windows + R). Type "shell:common startup" press "enter". Place a shortcut in that folder and restart your machine (depending on what the *.exe is doing you may need to set its properties to run as administrator).

Related

Why is [PrtSc] button not working in Intellij-Idea or Microsoft SQL Server Management Studio?

I'm using a thrid-party screen capturing application (Screenpresso). It's configured to start screen-capturing when I press PrtSc. And indeed it works except when Intellij has Windows focus. In fact, to screen capture code I have to focus on any other window press PrtSc and then select the area within Intellij.
I've looked through all the settings, and especially the Keymap settings, and I can't see anything else that has been assigned to PrtSc. Of course, I'm not really sure; when I try to find a setting via nothing happens, as pressing PrtSc has no effect.
I know this used to work for me in previous versions of Intellij (though I can't remember what versions). But PrtSc used to work in Intellij just like every other application.
So I guess the question is, why is Intellij eating the PrtSc keypress event? And can I turn it off so that the event gets correctly passed to my dedicated screen capturing application.
Intellij 2019.2.4
Windows 10, 64b
This turned out to be an issue with Screenpresso:
https://www.screenpresso.com/support/hot-keys/
Why shortcut [print screen] key does not always work?
This must be because you run your application with elevated
privileges (with admin rights) (the UAC must have displayed a popup
at startup).
For security reasons, Screenpresso can handle shortcuts
from Windows running with elevated privileges only when it is
installed in Program Files folder.
To fix this, you should install
Screenpresso in Program Files folder which is not the default
behavior:
Uninstall Screenpresso
Run again Screenpresso: Right click Screenpresso.exe and select Run as administrator
Click on the INSTALL on this computer button while holding the Control key or click on the sub-menu Install for all users:
Some users have this problem, first reported 5 years ago: Find here
Crash dumps (java_error_in_*.log in the user's home directory) can help to understand it better.

ClickOnce Settings Not Found When Run from Command Line

I have a Windows Forms app that is deployed through ClickOnce. In the app, I take advantage of the application settings to store basic connection information. In the two years and 200+ updates since I've published the app and it's been in daily use, I've had no problems with individual users modifying their own settings, and having those settings retained when the application is relaunched and updated.
However, I am working on adding a feature into the app that allows for certain tasks to be scheduled in the Task Scheduler. Everything works fine (the task is scheduled, and the application is called with the correct parameters passed) however when the program is launched, the settings are not read.
I can replicate this by manually launching the application directly from the command line. The application opens, but the only settings available are the settings that shipped with the application initially.
My end question is this: How can I call my ClickOnce app from the command line and have it open the same way as if I'd launched it from the start menu?
Thanks!!
Looks like the answer is to point the Task Scheduler to launch the .appref-ms file that is found in the start menu shortcut. You can't just point to the .exe file.
This is most likely caused by the Command line launching the ClickOnce App under a different user.
Try launching the ClickOnce from Command line or Task scheduler, and loading up task manager and seeing which user the app is running. If it is running on a user other than the user you are logged in as, then you can either log in as the user it is running under (if it's not a system user) and setting what settings you want, or you could try impersonating the desired user through task scheduler.
If none of that is applicable, you could add a Command line switch that, if no settings are found, saves a set of default settings that match what you want.

how to deploy Windows WPF Application?

I have a simple Windows Form application(WPF) with entity framework. After compiled, only a few files generated:
EntityFramework.dll
EntityFramework.xml
MyApp.exe
MyApp.application
MyApp.exe.config
...
Then I just copy following files to a network shared folder:
EntityFramework.dll
MyApp.exe
MyApp.exe.config
Then I can double click on MyApp.exe from developer computer the launch the app, but can not launch from another end user computer.
How to resolve this problem?
When you double click, app is not launching means certainly it is crashing so type the command eventvwr in run or cmd it'll open the Event viewer in that go to Windows Logs and Click on Application, you can see different levels of logs in that just find the last error log view the details it might help you
Have a look in the event log on the target computer and look at the error that is actually being reported.
It could be a missing installation of the correct version of the DotNet framework as suggested in the comments above, or it could also be that the execution policy of the target computer is preventing the user from running from a network drive (As a developer you probably have admin rights on your local pc allowing you to do this).
Whatever the actual cause you are always better to use some form of installer, rather than this form of putting files on the network (commonly known as xcopy deployment).
Probably the best solution is to use Visual studio to generate you a click once installer and publish it to your network drive. This will then copy the application locally on the users pc and run it from there.

Execution of QTP scripts on remote machines

I am posting this question regarding the execution of QTP scripts on remote machine. When i log in to my remote machine via "mstsc", and execute the script without closing the remote desktop connection, it works fine. But once i close/minimize the remote desktop window, it starts throwing error ( like Object not visible" error.
One of the places where it generally throws error is while clicking on the file menu in IE, as shown below :-
Browser(" page name -").WinToolbar("ToolbarWindow32").Press "&File"
Are there any workarounds to resolve the same??
Most of the QTP scripts take lot of time to execute, and if the prerequisite is to keep the screen active without even locking, isnt it one of the key disadvantages?
Thanks in advance!!!
Steve
QTP replays some steps by manipulating the mouse and keyboard devices. When an RDP session is minimized windows knows that there is nobody at the controls and therefore doesn't respond to the mouse and keyboard events which causes QTP to fail.
A workaround to this is to connect to the machine via another application rather than mstsc (for example VNC) which doesn't communicate to windows that it has been minimized. Either that or leave the RDP window open.
If you want to run QuickTest in a minimized RDP session, and you are using an RDP >= 6.0 client, you can enable it by setting a registry value on the local computer:
Navigate to one of the following registry paths on the local computer:
Current User: HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client
or
All Users: HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server Client
Create a DWORD value named RemoteDesktop_SuppressWhenMinimized and set it to 2.
Note that this does not work when the computer is locked or logged off.
one more simple way
just maximize RDP session , then scripts will run don't minimize
you remove the lock of the machine.

How to write a Kiosk application in Windows that has control from startup?

I'm not sure if this is technically a Kiosk, but it's basically the same idea. I have a program that runs full screen all the time from boot to shutdown to control a machine that the computer is hooked to.
Right now I just have a shortcut to the exe in the Startup folder so it starts when the system boots up and logs in. Is there any better way to do this? I'd really like the user to never see the Windows environment (just the windows loading progress bar on boot) if at all possible, but I'm guessing that's not possible.
Just thought I'd ask and see if there is a better way to do this than putting it in the startup folder?
The best option is to use Windows Embedded. This gives you much more control over the shell, and what is run and installed with the system.
If you have to do this with a consumer OS, you can try to bypass the login prompts to auto-login your user, and have your program setup in the registry to startup. Disable any other services you don't need. That will minimize the time the shell is displayed (but it's very difficult to remove it).

Resources