View Full Version : How to share the %AppFolder%
levanduyet
10-27-2008, 03:41 AM
Dear All,
When the installation process with Administator right, how can I set the security %AppFolder%. So, after installing, log-in again (not Aministrator right), then can use %AppFolder%.
Tks,
LVD
JXBURNS
10-27-2008, 11:13 AM
For reliable control of security permissions I use XCACL.VBS (search Google) and install it as a PRIMER file into the %TEMPLAUNCHFOLDER%
Then I use something like this in the ON PRE-INSTALL to create the %APPFOLDER% first before SUF8 installs any files. By doing this the files inherit the rights of the folder.
Note I have removed any error trapping which you need to insert to check things go well..
-- Make sure that XCACLS is in the Windows folder
result = File.Install(SessionVar.Expand("%TempLaunchFolder%\\XCACLS.vbs"), SessionVar.Expand("%WindowsFolder%\\XCACLS.VBS"), FILE_INSTALL_ALWAYS, false, false, nil, nil);
-- Set up the security on it so that the files inherit the same security.
File2Run = SessionVar.Expand("%SystemFolder%\\cscript.exe ")..SessionVar.Expand("%WindowsFolder%\\xcacls.vbs")
StatusDlg.Show()
StatusDlg.ShowProgressMeter(false)
StatusDlg.SetMessage("Creating folders and setting security...")
-- Now lets create the installation folder
Folder.Create(SessionVar.Expand("%AppFolder%"));
-- Set main folder to be read only for the security group USERS
Args2Run = SessionVar.Expand(" %AppFolder% /G USERS:X /E")
result = File.Run(File2Run..Args2Run, "","", SW_MINIMIZE, true);
-- And a subfolder that needs read/write access but don't allow deletion of the folder itself.
Folder.Create(SessionVar.Expand("%AppFolder%\\SubFolderName"));
-- Allow the SubFolderName folder files to be modifiable
Args2Run = SessionVar.Expand(" %AppFolder%\\XML /G USERS:B874321 /SPEC A /E")
Args2Run = SessionVar.Expand(" %AppFolder%\\SubFolderName /G USERS:BA987654321 /SPEC E /E")
result = File.Run(File2Run..Args2Run, "","", SW_MINIMIZE, true);
StatusDlg.Hide()
When you have downloaded XCACLS note that the readme file does not contain all of the switches, Use XCACLS /? to get a full run-down of what is available via the script.
The reason I use File.Run(File2Run..Args2Run...) is a hang-up from SUF7 where passing command arguments often failed whereas running them as the complete command line worked every time. I have not tested whether this is fixed in SUF8 as my philosophy is not to change something that works.
I have used this many times on both Windows Server and XP/Vista without any problems.
Rgds John
levanduyet
06-04-2009, 02:18 AM
Dear JXBURNS
-- Allow the SubFolderName folder files to be modifiable
Args2Run = SessionVar.Expand(" %AppFolder%\\XML /G USERS:B874321 /SPEC A /E")
Is this code correct?
Tks,
LVD
jassing
06-04-2009, 04:25 AM
you should be aware that some virus scanners (and system policies) may block a visual basic script -- especially one that alters system security.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.