does registry need to be changed to grant permission to a program? - debugging

i have made a game and it's self installer after the game is installed it runs only if it is installed on e drive or d drive not in the c drive that has my os
it says access denied
somebody told me that it needs permissions by making registry changes
is it so?
i know how make the changes
but what changes do i make??
Edited to add the text from the answer made by the person who created the question:
i was writing to c:\programfiles\abess\ and the installer runs successfully the installed program does not run ,i am using windows 7 home and using administrator account

Is it trying to write any files to C:\ on a Windows 7 (or possibly Vista) machine? If so, by default you won't have write permissions there (assuming the C: is the system drive). Make sure that your app writes any files to subdirectories of C:\, like C:\Temp\ or similar.
I'm fairly certain that if it works on D: but not on C: it won't be a problem with the registry.

i was writing to c:\programfiles\abess\
and the installer runs successfully the installed program does not run ,i am using windows 7 home and using administrator account
after installing if the program is run as "run as administrator" it runs successfully
i am making the installer i can't be sure if on the other end user installs on c:\programfiles\ and gets frustrated when program does not run

Related

How to unzip all folders in an executable files in Windows 7?

I have an executable file to install a software in Windows 7, which will unzip a number of folders inside it.
I tried with 1 computer and it worked. I tried with another computer and there left a number of folders that were not unzipped.
I assume this is some sort of Windows 7 security settings but I failed to google for a satisfactory solution.
Thanks.
I would need more specifics about the different machines you are using it.
If it is a security issue, you will be able to successfully run it as an administrator. Do this by right clicking on it and selecting Run as administrator.
If the user you are using is not the administrator you will be prompted for an account and password, otherwise you will see just an extend UAC warning message you can accept.
The nature of the .exe could determine why it might not successfully unpack as well as the location the files are going to when being unpacked.

RegSetValueEx requires run as administrator to work?

I have created a small vb6 application which edits the registry in HKLM hive. It makes use of function RegSetValueEx. But when run the exe file in windows 7 and windows 8 pc it does not edit the registry even if run it in administrator user.
In windows XP it works fine.If i run same application as "run as administrator"(by right clicking exe and then run as) in windows 7 and 8 then it works properly.I think the windows 7 and 8 id designed to work like this only. But is there any method i can edit it without running as administrator? Or is there any code in vb6 which does the same.
Here is my small code
Important:
When checking the code create exe and then run the exe and click on button(HKEY_LOCAL_MACHINE\SOFTWARE\Demo registry gets added in wow32 node because vb6 is a 32 bit appliaction).Running the code directly by opening code allows the registry to change.But creating the exe and then running it gives the problem which is the real time scenario in any application.
Microsoft has been warning developers since Windows 2000 that access to the HKLM branch of the registry should not be performed as normal user, as it will sooner or later be restricted to administrators. They also said you should not write to Program Files.
They didn't enforce that rule until Windows Vista, so nobody felt the need to change anything.
Now you have it: don't write to HKLM as normal user - it doesn't work. Don't write your settings to Program Files. It doesn't work.
Application run by the normal user may write their data to user folders and user hives in the registry, nowhere else.
If your application's sole purpose is to write to that value in the HKLM hive then you will need to add a "requiresAdministrator` manifest to the executable, causing Windows to prompt the user for admin access every time it's run.
If this is a small part of a larger project, then you should use COM elevation or just run a small stub executable with the manifest above, allowing windows to only prompt when it's required.
If your application doesn't require admin access at all then you should stop it trying to write to admin restricted locations, and instead use the user's own HKCU hive.

Writing to files on system drive C: without admin rights in Delphi

I am trying to write Memo text to a .txt file in Delphi XE3, in Windows 8, but for some reason when I run the program in the IDE it works (the temp .exe is on my D: drive) but when I copy my program to C:\Myprogram.exe it gives error "Access denied" so i cant write anywhere on C:\
I already tried making a manifest and that did not work.
P.S.: I don't want to run my program as an administrator and when I do run as admin it works.
If you're not an administrator, you cannot write in certain places. That is to protect you (or your users) and it's a rule you cannot circumvent without disabling UAC, which you should't rely on (if it's possible at all in Windows 8).
Pick a location you can write to, for instance a Documents folder or another special folder for storing application data.

Creating installation, Cant run application from programfiles if not admin

I made a small application and installation package for the application with installshield LE designed for Windows Xp/Windows7 32bit.
Everything is working ok but i have premission issues.
First of all, if user is not administrator then he cant install the installation package.
(In the Require administrative privileges i entered "No") - This issue is OS or installation package restriction ?
So.. I went to XP and logged in as normal user, i launched the installation and it elevated me to be admin. then I entered an admin password in order to continue the installation. afterwards everything went fine. now i cant start the application - only as administrator.
Why is that? how can i do that the user can run the application ?
it cant write the logs file (which my application writes) to the program files folder.. no premissions..
How can i handle this ? If a certain user installed the application i want him to be able to do anything with it. only the installation itself require admin log in.
Thanks
The Program Files folder is a very special directory. Only admins are supposed to make changes to that. If your installation writes logs to Program Files, it is just wrong.
If you need a normal user to install and interact with your application, you should create an application and an installer suited for STANDARD USER. Such an installer will not write anything into Program Files.
Have a look at this:
http://blogs.msdn.com/b/rflaming/archive/2006/09/30/778690.aspx

Visual Studio Setup Project folder permission

I have a setup project that installs my app to the typical program files directly.
My app periodically saves some temporary images to the apps installation folder. It seems on Vista, the permissions are not setup for write permissions. I can change it manually in windows explorer and it works, but I would rather have the setup project do that automatically.
How can I do this?
Is there a better/more normal place to put temp images that won't have permissions issues?
It is not Vista specific, this will happen with any kind of user account that doesn't have admin privileges. Your program just can't write to folders like c:\program files\blah. That UAC disables admin privileges has been publicized for a long time now. Use Environment.GetFolderPath() to get the path to an ApplicationData folder that you can write to.
See http://msdn.microsoft.com/en-us/library/bb756940.aspx for details on UAC issues for vista. These problems can also occur in other versions of windows when running applications from non-admin accounts. You should only write data to app data or temp directories and not program files.

Resources