Running Application at StartUp - c#

Hi i am running windows 7 64 bit.
I made an application that uses sql lite database and to do operation application has application manifist file to require admin.
Now issue is that i need to run this application when ever windows starts up it should run after login.
now i tried two approaches
1.Writing Registry Run
2.Creating ShortCut to StartUp Folder.
when ever i restart my application it does not start up.even if i get the path from regedit or startup shortcut is clicked the application starts up.
What is the Issue?
One thing i noticed that if application does not requires Admin permission then it launches. but in that case database exception occurs"Attempt to write a read only database"
but launching with admin rights Works on WinXP

did you check the permissions of the directory containing the sqlite db ? the directory should be write enabled

Related

attempt to write a read-only database sqlite Wpf inno setup [duplicate]

I am developing desktop database application. Using rdlc report and reportviewer. Everything was fine in developing process, reportviewer was showing all data smoothly. I deploy app with Inno Setup. But when I install the app, the reportviewer is not showing data. While data is correctly inserted in the tables.
For applications that work incorrectly or fail completely, when installed by Inno Setup to Program Files folder, the first thing to test, is to try to deploy the application manually to the same folder.
If the application fails even after a manual deployment, the most usual problem is that the application requires a user to have write permissions to application folder. As on modern versions of Windows a user typically does not have write permissions to the Program Files folder, the application does not work. So the problem usually has nothing to do with Inno Setup, but it's a problem of the application itself.
To solve the problem:
The best solution is to redesign the application so that it does not require write permissions to its folder. Windows applications should not require write permissions to their folder. That's against Windows guidelines. The application should write data to a user profile folder (C:\Users\username\AppData) or to a common data folder (C:\ProgramData).
A dirty workaround is have the installer grant a user(s) write permissions to the installation folder. Do that only, if you cannot get the application fixed (e.g. it's 3rd party application).
See Inno Setup - How to set permissions of installation folder.
Even more gross workaround is to configure the application to be executed with elevated (Administrator) privileges.
See Inno Setup desktop shortcut (link) which has "Run as administrator" advanced property set
or How to set 'Run as administrator' on a file using Inno Setup.
Another solution is enabling legacy compatibility mode that makes Windows redirect all application write attempts to a virtual store. See also Application installed with Inno Setup writes files to unknown location instead of its installation folder.
There are numerous other possible reasons, why the application might be failing when installed, including:
You omitted some dependency:
DLL library
.NET assembly
.NET Framework
Java Runtime Environment
other runtime
COM/ActiveX object, etc.
The application requires some configuration:
a file
a registry key [including COM/ActiveX object registration]
an environment variable, etc.
The application is not designed to be executed from a folder that has a space in its name (Program Files).
The application gets confused by Windows File virtualization (though it's unlikely). See Application installed with Inno Setup writes files to unknown location instead of its installation folder.

Winform application not running after installing into program files directory

I had created a windows form application and used setup project to create installer. But after installing my application the application is not opening from the location it is installed("c:\Programs Files(86x)\"). But the application runs fine if i copy the entire installed files to another drive. Actually my application is creating some folder inside the installed directory when running. so i thought it is some problem related to windows permissions. I had set app privileges as "requireAdministrator" and still not working. Can anyone help me with a solution?
Actually my application is creating some folder inside the installed directory when running.
Don't do that!
The Program Files folder is read only to standard users, and has been since Windows 2000. And since Windows Vista even Administrator users will require elevation to get write access into this folder.
Use the All Users Application Data folder instead (Environment.SpecialFolder.CommonApplicationData).
The alternative is an advanced installer product (meaning purchasing the full version of InstallShield or similar rather than the version included with Visual Studio) which supports adding an action to your install process that both creates the folder and sets new permissions, and does this at install time. But that's really a cheat, anyway. Just use Application Data.

Windows Service not writing text file after installation in Windows

I have created a console based app and running fine, and same app converted into windows services. When i install it through visual studio for debugging its install and run smoothly, but when the code flow goes to change the app.config file value 0 to 1 it throw an exception UnauthorizedAccessException' and access denied.
The issue can be due to one of these 2 reasons:
If you are not accessing file using an absolute path, the service might be looking for the file at a location other than where you are expecting.
Services are started from an application called Service Control
Manager. This application lives in the system directory
%WinDir%\System32
On a Windows 7 Ultimate - 64 bits this path is actually : %WinDir%\SysWOW64
The WindowsService process could be running under an account different
from what the Visual Studio might be running under.
Either you can make the service run under an account that already has permission to the file or give permissions to the account that the service is already running under.

Machine needing to restart after binary update of desktop application

We have one Desktop application build with .NET3.5 in VS 2008. It is deployed on Network location which is accessible across the firm. Shortcut is created on user's machine to start the application. Desktop is being build (compiled) in AnyCPU configuration as Some user using XP machine and some are using Windows 7. Whenever new build (dlls and exe) deployed on network location, user have to close the app and restart it to work properly
Problem
We are facing a issue whenever we deploy new build (dlls and EXE) of the application. On Windows 7 machine application is not starting if we close the current running instance. User has to restart the machine itself to get it work.
Any help or suggestion is appreciated.
There is limited info to go on but the first thing I would make sure of, is the application still running under the Processes tab in the task Manager?
Go to the task manager on the computer and check the running processes tab to see if this app is still running.
It could be that it doesn't shut itself down properly after the user quits the application.
If the program is still running in the background then Windows will require a restart before the new dll's are loaded.

Application slow after installation

I've created this WPF application and it's working fine and fast when running the release build from any folder.
Since it's done I made an installer (WiX) to install it into the program files folder. When I run my application from program files it's very slow and hangs all the time. Running as administrator makes it run normally again.
Why is this and how can I make it run normally without having to run as admin?
thanks.
I fixed this issue by enabling ClickOnce security settings in project properties and selected option This is a full trust application.

Categories