I have a program that I want to display a window above the start screen in Windows 8. The only way to do that (that I know of) requires I set the flag uiaccess=true in the manifest. But, in order for that to work, the user of the program needs to be an administrator. So, I tried this method to get a service I install with the program to launch the main program. This way the any user can run the program once installed.
The problem is the uiaccess flag. It seems that in order to launch a program as described in the article, but with uiaccess, the service itself needs to have the uiaccess flag enabled (or else CreateProcessAsUser fails). And whenever I try to install the service with the uiaccess flag, I get the error "this process requires elevation."
So, the main question is: Is there a way to install a service that has this flag enabled? I admit that I expect the answer to be "no". Since a service running in session 0 would normally have no reason to have this flag, since there's no ui component allowed. But, I'm hoping that I'm wrong and there is a way.
Thank you, let me know if I need to clear up anything.
Before CreateProcessAsUser and after DuplicateHandle use function SetTokenInformation with TokenUIAccess 1
Related
I've been trying to install Haskell platform with chocolatey but have been unable to get it working without running the command prompt as an administrator.
When I do so normally it just states that "ghci is not recognized as an internal or external command", but when I do so with admin privileges' it works fine.
I looked at this thread and attempted to add the pthread.dll file to my system but this seemed to just make the program run worse as admin. I'm confused why something that should be so basic as setting up a programming language is giving me so much headache
Ok, managed to fix it by making an environment variable directly to my C:\ProgramData\chocolatey\lib\ghc\tools\ghc-8.10.3\bin location.
I thought making an environment variable to C:\ProgramData\chocolatey\ would have been sufficient but clearly not. Weird too as Chocolatey added many of its own environment variables but not one that pointed to gchi
I'm building an installer using Inno Setup where I need to convert some existing files if the application is already installed.
To do so I need to stop the applications service which works automatically for the install process. Is there a way to hook a page between the application shutdown and start routine? Or to postpone the application restart to a later time?
EDIT:
I also tried CheckForMutexes('MyAppMutex') to manually prompt the user to close the application, but the function always returns false.
EDIT2:
My current workarround uses the isProcessRunning script by jakoch to prompt the user to manually close the application. I would prefer a more automatic solution though.
I am trying find a problem with my program that is hooking into a game. This is
vc++. Basically I launch the program and then hook into it using SDL. When I run the code from VS2010, all works fine. But when I try to run from command prompt, my program can launch the game, but after that the game crashes immediately.
I was viewing windows event logs, and it appears that there is an access violation. 0xc000005
How can I log any further details about the program that crashes? I tried "procdump" but that is not useful as I cannot INDIRECTLY target the hooked game from console. Rather it can only target my application that hooks.
Anyway of getting detailed dumps is highly appreciated in this case.
Thanks!
You can perform postmortem debugging by using a combination of the WER registry keys/values to trap any dump that is produced. I’ve used this method to prevent the WER system from collecting the dump file (.dmp). I’ve also written about this in another similar post. To accomplish this, you will need to create a registry key under
Software\Microsoft\Windows\Windows Error Reporting
if one does not already exist. The key should be
LocalDumps\your application.exe
Once that’s done, modify these keys/values to meet your needs:
DumpCount, DumpFolder, DumpType
You’ll need Administrator rights to create and modify the keys, and, you should reset everything you’ve modified when you’re done debugging.
I have an Inno Setup script that installs my application and its accompanying files.
On some systems a restart is required, on some not.
I would like to find out the reason for the required restart.
How would I do this most intelligently?
Thank you very much.
For debugging purposes you can peek inside
HKLM\System\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations
to see if there are any moves/renames/deletes queued for the next reboot.
(Sysinternals utility viewer)
Use /LOG when you run the install and then look at the log file that it generates (by default in %TEMP%). It should fairly clearly show in there which files were queued for replacement on restart, or which other reasons caused a restart request to be issued.
Usually restarts are triggered by overuse of restartreplace without using something like AppMutex to ensure that the application has been shut down properly before installing, or from subinstalls executed during [Run].
I have a QT application. When I use my created application launcher to start it, it doesn't work.
However, if I go to terminal and run the application from there, it works.
I'm wondering what their differences are.
Thanks.
Maybe your application launcher doesn't contain the right command and environment?
How is your launcher trying to start the program? Are any errors being reported?
It could be that the current directory is not set as expected. Or the command line parameters being sent aren't formatted correctly. Hard to say without seeing some code or an error message.