C:\Program Files (x86)\MyApp full permission using vba (1 Viewer)

gstylianou

Registered User.
Local time
Today, 15:33
Joined
Dec 16, 2013
Messages
357
Hi, is there a way to give full permission to my C:\Program Files (x86)\MyApp full permission using vba? I'm asking this because i don't want the user to see what i'm doing during the installation on PC

thanks
 

Minty

AWF VIP
Local time
Today, 13:33
Joined
Jul 26, 2013
Messages
10,371
Only if you use an installer program, VBA out of the box isn't enabled without a warning that it needs enabling.
Catch 22.
 

gstylianou

Registered User.
Local time
Today, 15:33
Joined
Dec 16, 2013
Messages
357
Only if you use an installer program, VBA out of the box isn't enabled without a warning that it needs enabling.
Catch 22.
Any idea about which installer program is best for that?
 

gstylianou

Registered User.
Local time
Today, 15:33
Joined
Dec 16, 2013
Messages
357
I tried to use the following batch file without result

@echo off
title folderpermission
icacls "C:\Program Files (x86)\MyAPPP" /inheritance:r /grant Administrators:TRUE
echo "Done!"
 

CJ_London

Super Moderator
Staff member
Local time
Today, 13:33
Joined
Feb 19, 2013
Messages
16,616
Any idea about which installer program is best for that?
you want one that is best for what you need to do, not just one aspect.

I've used INNO in the past - you can program it to go into the registry and apply a trusted folder (assuming the client's IT dept allows access to the registry) - but only useful if you know which folder your app is to be installed in - and doesn't stop the user from copying the app to somewhere untrusted.

Usually better to locate the app in a new folder in C:\Users\username\AppData\Local rather than the program folder
 

gstylianou

Registered User.
Local time
Today, 15:33
Joined
Dec 16, 2013
Messages
357
you want one that is best for what you need to do, not just one aspect.

I've used INNO in the past - you can program it to go into the registry and apply a trusted folder (assuming the client's IT dept allows access to the registry) - but only useful if you know which folder your app is to be installed in - and doesn't stop the user from copying the app to somewhere untrusted.

Usually better to locate the app in a new folder in C:\Users\username\AppData\Local rather than the program folder
I used the Inno Setup and already i created the following code in order to create successfully the master app folder into C\Program Files (x86). The Script file name is CreateMasterFolder.iss. Now the problem is how can i open this file using vba code into DB?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 13:33
Joined
Feb 19, 2013
Messages
16,616
you are not being very clear

inno doesn't use vba code - it just opens the file. If you are using inno then you need to include code there to modify the registry before you open the file
 

gstylianou

Registered User.
Local time
Today, 15:33
Joined
Dec 16, 2013
Messages
357
you are not being very clear

inno doesn't use vba code - it just opens the file. If you are using inno then you need to include code there to modify the registry before you open the file
i just save the inno script file with the name CreateMasterFolder.iss which includes all the lines so to create the folder into path

C:\Program Files (x86)\MyApp .​


What i need now is a vba code to open the above file within access..
 

sonic8

AWF VIP
Local time
Today, 14:33
Joined
Oct 27, 2015
Messages
998
i just save the inno script file with the name CreateMasterFolder.iss [...]

What i need now is a vba code to open the above file within access..
You can open it the same way as any other text file.
However, if you want to execute the commands in the file, you must compile the file using the Inno Setup compiler and then run the resulting setup.
I'm asking this because i don't want the user to see what i'm doing during the installation on PC
Because you are installing malware?
Probably not, but you could be. - That's the reason why writing to the Program Files folder requires Administrator permissions. Without these permissions, it will fail. Probably the reason why you had no luck with icacls.

If you really must install into the Program Files folder, build a proper setup that request Administrator permissions when executed. - Most likely you don't have to install into Program Files, and then you shouldn't do it. - Oh, and don't get the idea to put your Access database into Program Files, it will not work for users without administrator permissions.
 

isladogs

MVP / VIP
Local time
Today, 13:33
Joined
Jan 14, 2017
Messages
18,235
Agree with @sonic8.
Why are you concerned about what the user sees during installation?

Years ago when I started distributing Access apps, I originally wanted to use ProgramFiles as the install folder.
I abandoned that approach due to the important security features associated with that folder.

My solution was to specify a set location using subfolders of C:\Programs\MendipDataSystems\ which was set as a trusted location
This made writing the script for the installation software very straightforward and also ensured the installed app worked on first use with no additional steps required by the end user.
 

Users who are viewing this thread

Top Bottom