Setacl out of the binary table
Hello everybody,
got a new problem.
I would like to save the setacl.exe in the binary table and run it with this command at the end of the installation:
-on [INSTALLDIR] -ot file -actn ace -ace "n:S-1-5-32-545;p:change;s:y"
sadly I receive everytime this error code and I dont know what I am doing wrong:
Event Type: Error
Event Source: MsiInstaller
Event Category: None
Event ID: 11722
Date: 8/7/2008
Time: 4:55:25 PM
User: ADMINSTUDIOC\user
Computer: ADMINSTUDIOC
Description:
Product: My Project Name-2 -- Error 1722.There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action test, location: C:\WINDOWS\Installer\MSI2.tmp, command: -on C:\Program Files\set\ -ot file -actn ace -ace "n:S-1-5-32-545;p:change;s:y"
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Data:
0000: 7b 43 33 35 36 43 37 42 {C356C7B
0008: 42 2d 41 38 41 37 2d 34 B-A8A7-4
0010: 35 45 46 2d 41 46 45 31 5EF-AFE1
0018: 2d 43 33 38 34 42 41 31 -C384BA1
0020: 39 31 34 36 31 7d 91461}
I am using Wise or InstallShield. have the same fun with both.
has somebody an idea where the failure?
thx
got a new problem.
I would like to save the setacl.exe in the binary table and run it with this command at the end of the installation:
-on [INSTALLDIR] -ot file -actn ace -ace "n:S-1-5-32-545;p:change;s:y"
sadly I receive everytime this error code and I dont know what I am doing wrong:
Event Type: Error
Event Source: MsiInstaller
Event Category: None
Event ID: 11722
Date: 8/7/2008
Time: 4:55:25 PM
User: ADMINSTUDIOC\user
Computer: ADMINSTUDIOC
Description:
Product: My Project Name-2 -- Error 1722.There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action test, location: C:\WINDOWS\Installer\MSI2.tmp, command: -on C:\Program Files\set\ -ot file -actn ace -ace "n:S-1-5-32-545;p:change;s:y"
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Data:
0000: 7b 43 33 35 36 43 37 42 {C356C7B
0008: 42 2d 41 38 41 37 2d 34 B-A8A7-4
0010: 35 45 46 2d 41 46 45 31 5EF-AFE1
0018: 2d 43 33 38 34 42 41 31 -C384BA1
0020: 39 31 34 36 31 7d 91461}
I am using Wise or InstallShield. have the same fun with both.
has somebody an idea where the failure?
thx
0 Comments
[ + ] Show comments
Answers (8)
Please log in to answer
Posted by:
spartacus
16 years ago
Posted by:
mac-duff
16 years ago
Posted by:
Cybermage
16 years ago
Spartacus / macduff.
Hmm this sound very familiar i had with parameters when is try to use DPINST out of the binary table.
After some hours i found the solution to use the parameters /S /LM /PATH "[INSTALLDIR] and work flawless (only 1 " !)
Maybe worth to try. ( -on "[INSTALLDIR] -ot file -actn ace -ace "n:S-1-5-32-545;p:change;s:y" )
Hmm this sound very familiar i had with parameters when is try to use DPINST out of the binary table.
After some hours i found the solution to use the parameters /S /LM /PATH "[INSTALLDIR] and work flawless (only 1 " !)
Maybe worth to try. ( -on "[INSTALLDIR] -ot file -actn ace -ace "n:S-1-5-32-545;p:change;s:y" )
Posted by:
AngelD
16 years ago
Here is how I do it
Add SetACL.exe to the as Binary table with the name "SetACL.exe"
Add CA_SetAcl.vbs to the as Binary table with the name "CallSetACL"
Make sure the folder (INSTALLDIR) has been created with the CreateFolders action (CreateFolder table)
Adding the Custom Actions using ORCA
(Just copy'n past into ORCA, don't forgett that the lines must end with a "new line")
(You may need to tweak the InstallExecuteSequence.Sequence value)
Binary table
Name Data
CallSetACL {binary}
SetACL.exe {binary}
CustomAction table
Action Type Source Target
SetACLPerm 3078 CallSetACL SetACLPerm
SetACLSupport 6 CallSetACL SetACLSupport
InstallExecuteSequence table
Action Condition Sequence
SetACLSupport NOT Installed 1401
SetACLPerm NOT Installed 3775
Component table
Component ComponentId Directory_ Attributes Condition KeyPath
CreateFolder <ComponentId> INSTALLDIR 0
CreateFolder table
Directory_ Component_
INSTALLDIR CreateFolder
FeatureComponents table
Feature_ Component_
Complete CreateFolder
CA_SetAcl.vbs
Add SetACL.exe to the as Binary table with the name "SetACL.exe"
Add CA_SetAcl.vbs to the as Binary table with the name "CallSetACL"
Make sure the folder (INSTALLDIR) has been created with the CreateFolders action (CreateFolder table)
Adding the Custom Actions using ORCA
(Just copy'n past into ORCA, don't forgett that the lines must end with a "new line")
(You may need to tweak the InstallExecuteSequence.Sequence value)
Binary table
Name Data
CallSetACL {binary}
SetACL.exe {binary}
CustomAction table
Action Type Source Target
SetACLPerm 3078 CallSetACL SetACLPerm
SetACLSupport 6 CallSetACL SetACLSupport
InstallExecuteSequence table
Action Condition Sequence
SetACLSupport NOT Installed 1401
SetACLPerm NOT Installed 3775
Component table
Component ComponentId Directory_ Attributes Condition KeyPath
CreateFolder <ComponentId> INSTALLDIR 0
CreateFolder table
Directory_ Component_
INSTALLDIR CreateFolder
FeatureComponents table
Feature_ Component_
Complete CreateFolder
CA_SetAcl.vbs
Function SetACLSupport()
Dim SetACLPath : SetACLPath = ReturnTempFile()
Call ExtractBinary("SetACL.exe", SetACLPath)
Session.Property("SetACLPerm") = SetACLPath & "|" & Session.Property("INSTALLDIR")
End Function
Function SetACLPerm()
Dim SetACL : SetACL = Split(Session.Property("CustomActionData"), "|")(0)
Dim Directory : Directory = Split(Session.Property("CustomActionData"), "|")(1)
'// remove trailing "\" character
Directory = Mid(Directory, 1, Len(Directory) - 1)
Dim WshShell : Set WshShell = CreateObject("WScript.Shell")
Dim sComSpec : sComSpec = WshShell.ExpandEnvironmentStrings("%ComSpec%") & " /c"
Dim oExec : Set oExec = WshShell.Exec(sComSpec & " " & SetACL & " -on """ & Directory & """ -ot file -actn ace -ace n:Users;p:change")
Do While oExec.Status = 0
'WScript.Sleep 100
Loop
Dim sResult : sResult = oExec.StdOut.ReadAll
Call DeleteFile(SetACL)
Set oExec = Nothing
Set WshShell = Nothing
End Function
Function ExtractBinary(BinaryName, OutputFile)
Const msiReadStreamAnsi = 2
Dim Database : Set Database = Session.Database
Dim View : Set View = Database.OpenView("SELECT * FROM Binary WHERE Name = '" & BinaryName & "'")
View.Execute
Dim Record : Set Record = View.Fetch
Dim BinaryData : BinaryData = Record.ReadStream(2, Record.DataSize(2), msiReadStreamAnsi)
Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject")
Dim Stream : Set Stream = FSO.CreateTextFile(OutputFile, True)
Stream.Write BinaryData
Stream.Close
End Function
Function ReturnTempFile()
Const TemporaryFolder = 2
Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject")
Dim TempFolder : Set TempFolder = FSO.GetSpecialFolder(TemporaryFolder)
Dim Tempfile : Tempfile = FSO.GetTempName
ReturnTempFile = TempFolder.Path & "\" & Tempfile
End Function
Function DeleteFile(FilePath)
On Error Resume Next
Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject")
Call FSO.DeleteFile(FilePath, True)
End Function
Posted by:
AngelD
16 years ago
A typo;
Replace the line:
Dim oExec : Set oExec = WshShell.Exec(sComSpec & " " & SetACL & " -on """ & Directory & """ -ot file -actn ace -ace n:Users;p:change")
with
Dim oExec : Set oExec = WshShell.Exec(sComSpec & " " & SetACL & " -on """ & Directory & """ -ot file -actn ace -ace ""n:S-1-5-32-545;p:change;s:y""")
Replace the line:
Dim oExec : Set oExec = WshShell.Exec(sComSpec & " " & SetACL & " -on """ & Directory & """ -ot file -actn ace -ace n:Users;p:change")
with
Dim oExec : Set oExec = WshShell.Exec(sComSpec & " " & SetACL & " -on """ & Directory & """ -ot file -actn ace -ace ""n:S-1-5-32-545;p:change;s:y""")
Posted by:
mac-duff
16 years ago
Posted by:
shweta_kar
16 years ago
Hi,
If the INSTALLDIR is poitning to C:\ProgramFiles\ABC then mention the commadline as:
-on "[ProgramFilesFolder]ABC" -ot file -actn ace -ace "n:S-1-5-32-545;p:change;s:y"
also make sure there are no extra spaces while writing the commandline..
Other option is direclty mention the hardcore value
-on "C:\ProgramFiles\ABC" -ot file -actn ace -ace "n:S-1-5-32-545;p:change;s:y"
Regards,
Shweta
If the INSTALLDIR is poitning to C:\ProgramFiles\ABC then mention the commadline as:
-on "[ProgramFilesFolder]ABC" -ot file -actn ace -ace "n:S-1-5-32-545;p:change;s:y"
also make sure there are no extra spaces while writing the commandline..
Other option is direclty mention the hardcore value
-on "C:\ProgramFiles\ABC" -ot file -actn ace -ace "n:S-1-5-32-545;p:change;s:y"
Regards,
Shweta
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.