PC Review


Reply
Thread Tools Rate Thread

Full Control to Users programmatically

 
 
vovan
Guest
Posts: n/a
 
      10th Feb 2007
My VB6 program is installed by setup created in InstallShield 12.
Before Vista everything was working fine.
On Vista one of the operations (replace file located in c:\program files\my
program with another file) fails - my research showed me than there is an
error 70, 'Access denied'
After I set manually Full Control to Users of that machine everything works
fine.
Any advice how to set Full Control to Users programmatically from VB6 or
from InstallShield project.

Thank you
Vovan


 
Reply With Quote
 
 
 
 
Jack
Guest
Posts: n/a
 
      10th Feb 2007
I guess you need to change the design.
Do not use c:\program files folder.

"vovan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> My VB6 program is installed by setup created in InstallShield 12.
> Before Vista everything was working fine.
> On Vista one of the operations (replace file located in c:\program
> files\my program with another file) fails - my research showed me than
> there is an error 70, 'Access denied'
> After I set manually Full Control to Users of that machine everything
> works fine.
> Any advice how to set Full Control to Users programmatically from VB6 or
> from InstallShield project.
>
> Thank you
> Vovan
>



 
Reply With Quote
 
vovan
Guest
Posts: n/a
 
      10th Feb 2007
Most programs (at least before Vista) use this design.
There should be some other solution not related to change the design, I
hope.
Thanks

Vovan

"Jack" <replyto@it> wrote in message
news:(E-Mail Removed)...
>I guess you need to change the design.
> Do not use c:\program files folder.
>
> "vovan" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> My VB6 program is installed by setup created in InstallShield 12.
>> Before Vista everything was working fine.
>> On Vista one of the operations (replace file located in c:\program
>> files\my program with another file) fails - my research showed me than
>> there is an error 70, 'Access denied'
>> After I set manually Full Control to Users of that machine everything
>> works fine.
>> Any advice how to set Full Control to Users programmatically from VB6 or
>> from InstallShield project.
>>
>> Thank you
>> Vovan
>>

>
>



 
Reply With Quote
 
Jimmy Brush
Guest
Posts: n/a
 
      10th Feb 2007
Two things you are doing wrong here:

1) Your program can only modify Program Files during install time, from a
Windows Service, a privileged scheduled task, of if your program prompts the
user for administrator permission.

If this is part of the "setup" process for your app, it needs to be
implemented as a custom action in the setup program (marked as do not
impersonate).

Otherwise, as Jack suggested, there is probably a better way to do what you
need to do.

In Windows Vista, only programs that ask the user for admin permission can
perform administrative tasks, such as modifying files in Program Files.

Programs that do not have admin permission can only save files to the
personal folders associated with the user (such as their documents folder),
or folders set aside by the system for application storage.

2) DO NOT CHANGE SECURITY SETTINGS ON SYSTEM FILES PROGRAMATICALLY. *EVER*.



--
- JB
Microsoft MVP - Windows Shell/User

Windows Vista Support Faq
http://www.jimmah.com/vista/

 
Reply With Quote
 
vovan
Guest
Posts: n/a
 
      10th Feb 2007
I need a full control for Users on "C:\Program Files\My Program" folder.
I had it for more than 10 years with no problem (before Vista). What's wrong
with my wish now?
It looks like you lived your live with 2 legs, you drove many cars. Now
somebody created a new kind of car requirening you to have 3 legs. And they
say that it's much better for you not allowing you to have any choice. They
are going to replace all existing models with new ones.
I found some way (using Windows script) to give Users full control on
"C:\Program Files\My Program", not on entire "C:\Program Files\". Just on my
folder.
It looks like adjustment will take much less time than full redesign.
What is wrong with this approach?

Thank you
Vovan

"vovan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> My VB6 program is installed by setup created in InstallShield 12.
> Before Vista everything was working fine.
> On Vista one of the operations (replace file located in c:\program
> files\my program with another file) fails - my research showed me than
> there is an error 70, 'Access denied'
> After I set manually Full Control to Users of that machine everything
> works fine.
> Any advice how to set Full Control to Users programmatically from VB6 or
> from InstallShield project.
>
> Thank you
> Vovan
>



 
Reply With Quote
 
Jimmy Brush
Guest
Posts: n/a
 
      10th Feb 2007
It destroys the built-in security provided by Windows.

Changing this security setting allows ANY PROGRAM ran by ANY USER to modify
your program's files. This is unacceptable - Program Files is only to be
modified by administrators.

If you want to do this on your computer - hey, that's your choice, go right
ahead.

But you CANNOT make this choice for the users of your program - you will
weaken the security of their system, without their consent, as a result of
your actions.

You must follow the programming guidelines enforced by Microsoft on behalf
of all the users of their operating system.

--
- JB
Microsoft MVP - Windows Shell/User

Windows Vista Support Faq
http://www.jimmah.com/vista/

"vovan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I need a full control for Users on "C:\Program Files\My Program" folder.
> I had it for more than 10 years with no problem (before Vista). What's
> wrong with my wish now?
> It looks like you lived your live with 2 legs, you drove many cars. Now
> somebody created a new kind of car requirening you to have 3 legs. And
> they say that it's much better for you not allowing you to have any
> choice. They are going to replace all existing models with new ones.
> I found some way (using Windows script) to give Users full control on
> "C:\Program Files\My Program", not on entire "C:\Program Files\". Just on
> my folder.
> It looks like adjustment will take much less time than full redesign.
> What is wrong with this approach?
>
> Thank you
> Vovan
>
> "vovan" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> My VB6 program is installed by setup created in InstallShield 12.
>> Before Vista everything was working fine.
>> On Vista one of the operations (replace file located in c:\program
>> files\my program with another file) fails - my research showed me than
>> there is an error 70, 'Access denied'
>> After I set manually Full Control to Users of that machine everything
>> works fine.
>> Any advice how to set Full Control to Users programmatically from VB6 or
>> from InstallShield project.
>>
>> Thank you
>> Vovan
>>

>
>


 
Reply With Quote
 
mayayana
Guest
Posts: n/a
 
      10th Feb 2007

> I found some way (using Windows script) to give Users full control on
> "C:\Program Files\My Program", not on entire "C:\Program Files\". Just on

my
> folder.
> It looks like adjustment will take much less time than full redesign.
> What is wrong with this approach?


That sounds like a good idea to me.
How do you achieve that?

(My best idea for a solution so far is a note saying
something like: "If you have the misfortune to be using
Windows Vista, and you want to use this software,
then you will need to give yourself permission to
fully use your PC."


 
Reply With Quote
 
vovan
Guest
Posts: n/a
 
      10th Feb 2007
I created a function:
Public Function SetUsersPermission(strFolder As String) As Integer
'Call this function when a new folder is created in Coordinator Folder
'to give a Full Access to Users
Dim objShell As Object
Dim intRunError As Integer
On Error Resume Next
intRunError = 1 'in case of error that value will be returned
Set objShell = CreateObject("Wscript.Shell")
'objShell.Run returns 0 if success
intRunError = objShell.Run("cmd /c cacls " & strFolder & " /e /g
Users:F", 0)
SetUsersPermission = intRunError
End Function

I call it every time I'm creating a new folder which is going to be accessed
by my program to save there some file.

Vovan

"mayayana" <(E-Mail Removed)> wrote in message
news:Zzmzh.22883$(E-Mail Removed)...
>
>> I found some way (using Windows script) to give Users full control on
>> "C:\Program Files\My Program", not on entire "C:\Program Files\". Just on

> my
>> folder.
>> It looks like adjustment will take much less time than full redesign.
>> What is wrong with this approach?

>
> That sounds like a good idea to me.
> How do you achieve that?
>
> (My best idea for a solution so far is a note saying
> something like: "If you have the misfortune to be using
> Windows Vista, and you want to use this software,
> then you will need to give yourself permission to
> fully use your PC."
>
>



 
Reply With Quote
 
Kerry Brown
Guest
Posts: n/a
 
      10th Feb 2007
Why would you want to risk doing this? What will happen when some user finds
out you modified their system needlessly and lowered their security. It is
their computer not yours. Are you so arrogant that you think your program
can do whatever it wants to someone else's computer or are you just too lazy
to lean how to do things properly? You will potentially alienate your
customers at best and possibly set yourself up for a lawsuit at worst. Vista
is here. Learn to program for it.

--
Kerry Brown
Microsoft MVP - Shell/User
http://www.vistahelp.ca


"vovan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I created a function:
> Public Function SetUsersPermission(strFolder As String) As Integer
> 'Call this function when a new folder is created in Coordinator Folder
> 'to give a Full Access to Users
> Dim objShell As Object
> Dim intRunError As Integer
> On Error Resume Next
> intRunError = 1 'in case of error that value will be returned
> Set objShell = CreateObject("Wscript.Shell")
> 'objShell.Run returns 0 if success
> intRunError = objShell.Run("cmd /c cacls " & strFolder & " /e /g
> Users:F", 0)
> SetUsersPermission = intRunError
> End Function
>
> I call it every time I'm creating a new folder which is going to be
> accessed by my program to save there some file.
>
> Vovan
>
> "mayayana" <(E-Mail Removed)> wrote in message
> news:Zzmzh.22883$(E-Mail Removed)...
>>
>>> I found some way (using Windows script) to give Users full control on
>>> "C:\Program Files\My Program", not on entire "C:\Program Files\". Just
>>> on

>> my
>>> folder.
>>> It looks like adjustment will take much less time than full redesign.
>>> What is wrong with this approach?

>>
>> That sounds like a good idea to me.
>> How do you achieve that?
>>
>> (My best idea for a solution so far is a note saying
>> something like: "If you have the misfortune to be using
>> Windows Vista, and you want to use this software,
>> then you will need to give yourself permission to
>> fully use your PC."
>>
>>

>
>


 
Reply With Quote
 
vovan
Guest
Posts: n/a
 
      10th Feb 2007
I'm doing it for the folder with my program. What is wrong with this? I said
I do not give permission to the entire Program Files folder.
What is the difference if I move my program to different location and will
allow to access its folders there?
What about a lawsuit for such companies like Adobe with their Photoshop,
which stores temp files in its folder. I did not test it on Vista yet, but I
think there might be some problems with permission too.

I'm looking for the fastest way to adopt my program to Vista for now. Later
I will think about the need to redisign it.
Now my clients are going to by new machines with Vista. I tested my program
on it and many features do not work. So, what is the best way from your
point of view to give them the ability to use my program on Vista. Ask them
to wait until I redesign everything?
I also woud ask if there is anybody else as stupid as me who did not have
any problem with security before, but with Vista has them. Or it's just me?
Everybody else knew all the time that it's a bad idea to install his (her )
program in Program Files folder. Everybody always knew that it's a bad idea
to store temporary files in its program folder. Everybody always knew that
Microsoft is going to change their security phylosophy. Only I did not know
anything.

Thank you

Vovan

"Kerry Brown" <(E-Mail Removed)*a*m> wrote in message
news:(E-Mail Removed)...
> Why would you want to risk doing this? What will happen when some user
> finds out you modified their system needlessly and lowered their security.
> It is their computer not yours. Are you so arrogant that you think your
> program can do whatever it wants to someone else's computer or are you
> just too lazy to lean how to do things properly? You will potentially
> alienate your customers at best and possibly set yourself up for a lawsuit
> at worst. Vista is here. Learn to program for it.
>
> --
> Kerry Brown
> Microsoft MVP - Shell/User
> http://www.vistahelp.ca
>
>
> "vovan" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I created a function:
>> Public Function SetUsersPermission(strFolder As String) As Integer
>> 'Call this function when a new folder is created in Coordinator Folder
>> 'to give a Full Access to Users
>> Dim objShell As Object
>> Dim intRunError As Integer
>> On Error Resume Next
>> intRunError = 1 'in case of error that value will be returned
>> Set objShell = CreateObject("Wscript.Shell")
>> 'objShell.Run returns 0 if success
>> intRunError = objShell.Run("cmd /c cacls " & strFolder & " /e /g
>> Users:F", 0)
>> SetUsersPermission = intRunError
>> End Function
>>
>> I call it every time I'm creating a new folder which is going to be
>> accessed by my program to save there some file.
>>
>> Vovan
>>
>> "mayayana" <(E-Mail Removed)> wrote in message
>> news:Zzmzh.22883$(E-Mail Removed)...
>>>
>>>> I found some way (using Windows script) to give Users full control on
>>>> "C:\Program Files\My Program", not on entire "C:\Program Files\". Just
>>>> on
>>> my
>>>> folder.
>>>> It looks like adjustment will take much less time than full redesign.
>>>> What is wrong with this approach?
>>>
>>> That sounds like a good idea to me.
>>> How do you achieve that?
>>>
>>> (My best idea for a solution so far is a note saying
>>> something like: "If you have the misfortune to be using
>>> Windows Vista, and you want to use this software,
>>> then you will need to give yourself permission to
>>> fully use your PC."
>>>
>>>

>>
>>

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How to programmatically modify the users full control Pete Delgado Windows Vista Security 0 10th Jul 2008 07:29 PM
Re: How to programmatically modify the users full control Kerry Brown Windows Vista Security 0 5th Jul 2008 05:57 PM
Re: How to programmatically modify the users full control Charlie Tame Windows Vista Security 0 5th Jul 2008 04:05 PM
Full Control to Users programmatically vovan Windows Vista Administration 55 25th May 2007 09:54 PM
Full Control to Users programmatically vovan Windows Vista General Discussion 55 25th May 2007 09:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:36 PM.