/build/static/layout/Breadcrumb_cap_w.png

Calling SetACL silently

I used to call SetACL from my deployment tool, but now I'm at a place that wants to call it from the MSI.
I've streamed in the binary and set my command line (using -silent) and it works great, but it pops a blank CMD window for one second. It does this even if I drop SetACL.exe to the machine first as part of my package.
How are people calling it so it's silent? VBS? CMD /c?
Thanks.

0 Comments   [ + ] Show comments

Answers (11)

Posted by: turbokitty 17 years ago
6th Degree Black Belt
2
I wrote a little VBS.. getting the nested quotes right was interesting.

Calls SetACL from the local drive (SetACL delivered with MSI)
It assigns full control to the local user group to a folder called "targetfolder".
It logs the results.
All silent.

------------------------------------start vbs---------------------------
dim oWsh
Set oWsh = CreateObject("WScript.Shell")
oWsh.Run """C:\program files\setacl\setacl.exe"" -on ""c:\program files\targetfolder"" -ot file -actn ace -ace ""n:S-1-5-32-545;p:full;s:y"" -actn clear -clr ""dacl,sacl"" -actn rstchldrn -rst ""dacl,sacl"" -log ""c:\program files\setacl\setacl.log"" -silent", 0, True
------------------------------------end script-----------------------------------------------------------

Custom Action:
Streamed VBS into MSI
Asynchronous (no exit code)
Deferred Execution in System Context
Sequence: After Register Product
Posted by: bheers 17 years ago
Second Degree Blue Belt
0
Not an ideal way but, you can make a wse script and make it hidden, then call this script in the MSI with a /s
Posted by: turbokitty 17 years ago
6th Degree Black Belt
0
Thanks for the suggestion. I'm actually not using Wise so I'm looking for a vendor neutral solution (ex. vbs) or one geared for Installshield.
Posted by: peska 17 years ago
Senior Yellow Belt
0
Hi,

You could use Embeded JScript as a CustomAction.
Make sure the custom action runs as "Deferred Execution - System Context".

use the following JScript Code. Insert the fullpath to the executeable and parameters.
////////////////////

wshShell = new ActiveXObject("WScript.Shell");
wshShell.Run("full-path-to-executable and parameters",0,true);

///////////////////


peska
Posted by: nheim 17 years ago
10th Degree Black Belt
0
Hi turbokitty,
have a look at: http://www.appdeploy.com/scripts/view.asp?id=523
There, i have posted the usage of 'setacl.ocx from within a MSI-Package.
Hope this helps.
Regards, Nick
Posted by: turbokitty 17 years ago
6th Degree Black Belt
0
Peska, your script won't work because my command line has quotes in it.. see below:

setacl.exe -on "c:\program files\my folder" -ot file -actn ace -ace "n:S-1-5-32-545;p:full;s:y" -actn clear -clr "dacl,sacl" -actn rstchldrn -rst "dacl,sacl" -silent

I'm not familiar with Jscript. Is there a way around that?


nheim,
Thanks for the link, I'll give yours a try next.

Thanks for the replies.
Posted by: MSIMaker 17 years ago
2nd Degree Black Belt
0
Nice one Kitty....I'll rate that a 2 for doing it yourself :)


ORIGINAL: turbokitty

I wrote a little VBS.. getting the nested quotes right was interesting.

Calls SetACL from the local drive (SetACL delivered with MSI)
It assigns full control to the local user group to a folder called "targetfolder".
It logs the results.
All silent.

------------------------------------start vbs---------------------------
dim oWsh
Set oWsh = CreateObject("WScript.Shell")
oWsh.Run """C:\program files\setacl\setacl.exe"" -on ""c:\program files\targetfolder"" -ot file -actn ace -ace ""n:S-1-5-32-545;p:full;s:y"" -actn clear -clr ""dacl,sacl"" -actn rstchldrn -rst ""dacl,sacl"" -log ""c:\program files\setacl\setacl.log"" -silent", 0, True
------------------------------------end script-----------------------------------------------------------

Custom Action:
Streamed VBS into MSI
Asynchronous (no exit code)
Deferred Execution in System Context
Sequence: After Register Product
Posted by: peska 17 years ago
Senior Yellow Belt
0
ORIGINAL: turbokitty

>> Peska, your script won't work because my command line has quotes in it.. see below:

To use quotes inside a string in JScript just precede the quote with a backslash.
(Also i Jscript remember to use double backslashes)

Example:
wshShell.Run("\"C:\\Program Files\\Internet Explorer\\Iexplore.exe\" \"C:\\Program Files\\Common Files\"",0,true);
Posted by: schieb 15 years ago
Purple Belt
0
ORIGINAL: nheim

Hi turbokitty,
have a look at: http://www.appdeploy.com/scripts/view.asp?id=523
There, i have posted the usage of 'setacl.ocx from within a MSI-Package.
Hope this helps.
Regards, Nick



This URL redirects now. Do you happen to have this around on the site somewhere still? Thanks.
Posted by: bkelly 15 years ago
Red Belt
0
Sorry, the script library that was here was actually a mirror of one hosted at AdminScriptEditor.com. I know that that site's script database was lost a year or so ago. It has since been rebuilt and enhanced. It is very nice, but if you are looking for an old script it is probably no longer available. [:(]

http://www.adminscripteditor.com/SLP/
Posted by: Lillude 17 years ago
Senior Purple Belt
-1
/silent option can be used.
it just pops up a command prompt and then the command window vanishes once it has set the permissions (hardly takes 5 secs).
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ