Answered by:
Problem in MSI Installation "run at admnistrtor"

Question
-
Hi
I have created a Installer MSI file for my client.
in my application, we used trial version and license version.
to maintain the trial version- I have created a hidden file in the location " c:\windows\System32\file.doc" at the first time run the application after the MSI installed.
my problem is, when client has Installed the application, and click the application Icon, they have got a error message "run at administrator" .
i have tested this error some system and after right click and select the option 'run at administrator' and application has been working properly.
so Please help me, what will i do, run this application every where without "run at administrator" option.
Note:- in my pointview, this problem has arised to create a file "c:\windows\System32\file.doc" in this location.so i have changed this location but problem is remain same
Plesae help me
Thanks In advance
Dipendra
Thursday, February 10, 2011 12:43 PM
Answers
-
If your application wants to create a file in the system32 folder, it needs administrator permissions. Change the file location to a place where the user has write permissions, then it should work without admin rights.
Now I'm not sure if you problem is that your application shows the user account control (UAC) dialog to request admin rights and you want to get rid of this, or if your application does not show this dialog but you want it to show.
Stefan Krueger, Microsoft MVP - Windows Installer, www.InstallSite.org- Marked as answer by Jie Bao Friday, February 25, 2011 2:15 AM
Thursday, February 10, 2011 4:59 PM
All replies
-
If your application wants to create a file in the system32 folder, it needs administrator permissions. Change the file location to a place where the user has write permissions, then it should work without admin rights.
Now I'm not sure if you problem is that your application shows the user account control (UAC) dialog to request admin rights and you want to get rid of this, or if your application does not show this dialog but you want it to show.
Stefan Krueger, Microsoft MVP - Windows Installer, www.InstallSite.org- Marked as answer by Jie Bao Friday, February 25, 2011 2:15 AM
Thursday, February 10, 2011 4:59 PM -
hi
thanks for the reply
in my requirement - if user trial period has expired then this hidden file is exist there,
so when user want to uninstall the application and try to use the trial period of this application so this hidden file restrict the use of application.
so user not able to re-use the software .
and "c:/windows/system32" folder is secure place to hide the file.
Thanks
Dipendra
Friday, February 11, 2011 6:58 AM -
Hi Dipendra,
>a error message "run at administrator"
Is it a error or the dialog which requests for admin rights?
>in my pointview, this problem has arised to create a file "c:\windows\System32\file.doc" in this location.so i have changed this location but problem is remain same
If that can not solve your problem, I think it is not the problem of the file's location. Is there some code in your project that needs admin rights?
Sincerely,
Vin Jin
Vin Jin [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Monday, February 14, 2011 7:41 AM -
Hi
Thanks for the reply
>a error message "run at administrator"
it is the dialog which requests for admin rights.
>in my pointview, this problem has arised to create a file "c:\windows\System32\file.doc" in this location.
my code is correct, its work fine but problem arise
when user have not admin right and try to install the MSI and MSI try to create file in "c:\windows\System32\file.doc" this location.
my aim is :- i want to create a file in this location "c:\windows\System32\file.doc" and after creation i want to read this file through my Program either i have admin right or not.
Thanks
Dipendra
Wednesday, February 23, 2011 6:52 AM -
Hi Dipendra,
Yup, if the user has no right , he will not able to access "c:\..". So how about creating your file in the other disk like "d:\" or "e:\".
Vin Jin [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Proposed as answer by Jie Bao Friday, February 25, 2011 2:15 AM
Thursday, February 24, 2011 8:09 AM -
Hi
Thanks for the reply.
Yes , you are correct.
Now i have created my file appData folder and its work.
Thanks for Your support
Dipendra
Thursday, February 24, 2011 2:14 PM