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.
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)
Please log in to answer
Posted by:
turbokitty
17 years ago
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
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
Posted by:
turbokitty
17 years ago
Posted by:
peska
17 years ago
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
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
Posted by:
turbokitty
17 years ago
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.
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
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
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
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
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/
http://www.adminscripteditor.com/SLP/
Posted by:
Lillude
17 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.