Having trouble running installing an MSI file using the batch command - batch-file

I have created the following batch file based on the recommendation Stein Åsmul.
Here's the link: Batch script to install MSI
When I run the batch file the program the .msi file does not install and instead .msi file gets deleted from within the folder.
A copy of my batch file code, pretty simple:
echo.
Echo Installing EZL Consumer IDM 3.12.0036 now.
msiexec.exe/i c:\InstallationFiles\EZL\EZL3.12.0036InstallPrePackaged\
EasyLenderConsumerIDM3.12.0036Update3.msi
/QN /L*V "C:\Temp\msilog.log
echo Installation complete.
attached copy of msilog.log
=== Verbose logging started: 12/01/2014 9:33:23 Build type: SHIP UNICODE 5.00.7601.00
Calling process: C:\Windows\SysWOW64\msiexec.exe ===
MSI (c) (DC:80) [09:33:23:232]: Resetting cached policy values
MSI (c) (DC:80) [09:33:23:232]: Machine policy value 'Debug' is 0
MSI (c) (DC:80) [09:33:23:232]: ******* RunEngine:
******* Product:
c:\InstallationFiles\EZL\EZL3.12.0036InstallPrePackaged\EasyLenderConsumerIDM3.12.0036Update3.msi
******* Action:
******* CommandLine: **********
MSI (c) (DC:80) [09:33:23:233]: Client-side and UI is none or basic: Running entire install on
the server.
MSI (c) (DC:80) [09:33:23:233]: Grabbed execution mutex.
MSI **strong text**(c) (DC:80) [09:33:23:366]: Cloaking enabled.
MSI (c) (DC:80) [09:33:23:366]: Attempting to enable all disabled privileges before calling
Install on Server
MSI (c) (DC:80) [09:33:23:394]: Incrementing counter to disable shutdown. Counter after
increment: 0
MSI (s) (8C:CC) [09:33:23:402]: Running installation inside multi-package transaction
c:\InstallationFiles\EZL\EZL3.12.0036InstallPrePackaged\EasyLenderConsumerIDM3.12.0036Update3.msi
MSI (s) (8C:CC) [09:33:23:402]: Grabbed execution mutex.
MSI (s) (8C:F4) [09:33:23:404]: Resetting cached policy values
MSI (s) (8C:F4) [09:33:23:404]: Machine policy value 'Debug' is 0
MSI (s) (8C:F4) [09:33:23:404]: ******* RunEngine:
******* Product:
c:\InstallationFiles\EZL\EZL3.12.0036InstallPrePackaged\EasyLenderConsumerIDM3.12.0036Update3.msi
******* Action:
******* CommandLine: **********
MSI (s) (8C:F4) [09:33:23:405]: Note: 1: 2203 2:
c:\InstallationFiles\EZL\EZL3.12.0036InstallPrePackaged\
EasyLenderConsumerIDM3.12.0036Update3.msi
3: -2147287037
MSI (s) (8C:F4) [09:33:23:405]: MainEngineThread is returning 3
MSI (s) (8C:CC) [09:33:23:406]: User policy value 'DisableRollback' is 0
MSI (s) (8C:CC) [09:33:23:406]: Machine policy value 'DisableRollback' is 0
MSI (s) (8C:CC) [09:33:23:406]: Incrementing counter to disable shutdown. Counter after
increment: 0
MSI (s) (8C:CC) [09:33:23:406]: Note: 1: 1402 2:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2
MSI (s) (8C:CC) [09:33:23:406]: Note: 1: 1402 2:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2
MSI (s) (8C:CC) [09:33:23:407]: Note: 1: 1402 2:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\InProgress 3: 2
MSI (s) (8C:CC) [09:33:23:407]: Note: 1: 1402 2:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\InProgress 3: 2
MSI (s) (8C:CC) [09:33:23:407]: Decrementing counter to disable shutdown. If counter >= 0,
shutdown will be denied. Counter after decrement: -1
MSI (s) (8C:CC) [09:33:23:407]: Restoring environment variables
MSI (c) (DC:80) [09:33:23:408]: Decrementing counter to disable shutdown. If counter >= 0,
shutdown will be denied. Counter after decrement: -1
MSI (c) (DC:80) [09:33:23:409]: MainEngineThread is returning 3
=== Verbose logging stopped: 12/01/2014 9:33:23

C:\Users\User>net helpmsg 3
The system cannot find the path specified.
or
-2147287037 = 80030003
8003 is structured storage
0x80030003 STG_E_PATHNOTFOUND The path %1 could not be found.

Related

msiexec installation keeps running into a "A required privilege is not held by the client." error

I am working on a software add-on batch script install, the main program installs without an issue, however the add-on potion of the installation keeps running into a "A required privilege is not held by the client." error.
I have tried running the batch script from my regular user account and also from my separate admin account, no difference. There is no such error when doing an installation with the msi file manually.
An insert from my script:
set base_path=%~dp0
start /wait msiexec /i "%base_path%\PDF995AddIn2Setup.msi" InstallDir="%SystemDrive%\pdf995\PDF995AddIn2" /qb /L*V! "C:\PDF995_and_AddIn.log"
I have already tried numerous things to try and fix this error code to no avail.
Running the batch script through an Administrator Command Prompt: same error
Reformatting the msiexec command line and trying different file paths / options: same error
Changing User Account Control (UAC) settings: same error
Modifying/Adding Registry Keys: same error
What I found in the log file:
MSI (s) (BC:E4) [10:32:45:926]: Note: 1: 2205 2: 3: MsiPatchCertificate
MSI (s) (BC:E4) [10:32:45:927]: LUA patching is disabled: missing MsiPatchCertificate table
MSI (s) (BC:E4) [10:32:45:928]: Resolving source.
MSI (s) (BC:E4) [10:32:45:929]: Resolving source to launched-from source.
MSI (s) (BC:E4) [10:32:45:930]: Setting launched-from source as last-used.
MSI (s) (BC:E4) [10:32:45:931]: PROPERTY CHANGE: Adding SourceDir property. Its value is '\Install\Standard_Apps\all\PDF995\PDF995\'.
MSI (s) (BC:E4) [10:32:45:932]: PROPERTY CHANGE: Adding SOURCEDIR property. Its value is '\Install\Standard_Apps\all\PDF995\PDF995\'.
MSI (s) (BC:E4) [10:32:45:933]: PROPERTY CHANGE: Adding SourcedirProduct property. Its value is '{A34C938B-756F-498B-AE52-517C66ED300F}'.
MSI (s) (BC:E4) [10:32:45:934]: SOURCEDIR ==> \Install\Standard_Apps\all\PDF995\PDF995\
MSI (s) (BC:E4) [10:32:45:935]: SOURCEDIR product ==> {A34C938B-756F-498B-AE52-517C66ED300F}
MSI (s) (BC:E4) [10:32:48:044]: Note: 1: 1314 2: \Install\Standard_Apps\all\PDF995\PDF995\
MSI (s) (BC:E4) [10:32:48:045]: SECREPAIR: Error in CreatePath
MSI (s) (BC:E4) [10:32:48:046]: SECUREREPAIR: SecureRepair Failed. Error code: 522FE515FB8
MSI (c) (54:98) [10:32:48:054]: Font created. Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg
Error 1314. A required privilege is not held by the client.
MSI (s) (BC:E4) [10:42:51:580]: Note: 1: 2262 2: Error 3: -2147287038
MSI (s) (BC:E4) [10:42:51:581]: Product: PDF995AddIn2 -- Error 1314. A required privilege is not held by the client.

What does this ghostscript error means undefinedfilename in

I want to run the Ghostscript command for drawing lines from a C program. I am using execlp() system call to run the command. When I am trying to run the command for line drawing from terminal/C, I am getting the same error like this:
GPL Ghostscript 9.55.0 (2021-09-27)
Copyright (C) 2021 Artifex Software, Inc. All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
Error: /undefinedfilename in (100)
Operand stack:
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push
Dictionary stack:
--dict:761/1123(ro)(G)-- --dict:0/20(G)-- --dict:75/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 9.55.0: Unrecoverable error, exit code 1
The command I am running for drawing is this postscript command(drawing a line)
gs 100 100 moveto 300 300 lineto closepath stroke
You need to add the flag "-c".
The gs command will then be
gs -c 100 100 moveto 300 300 lineto closepath stroke

Jenkins - OpenCover batch command cant find pdb files

I am trying to follow these instructions for my system and am as far as step 8 (unit tests & coverage).
When I execute this command on the server it works succesfully:
"C:\Program Files (x86)\OpenCover\OpenCover.Console.exe" -register:user -target:"C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" -targetargs:"C:\workspace\Extensions\Extensions\ExtensionTests\bin\Debug\ExtensionsTests.dll -result=TestResult.xml;format=nunit2" -filter:+
If I add it as a Jenkins Batch command step I get:
"C:\Program Files (x86)\OpenCover\OpenCover.Console.exe" -register:user -target:"C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" -targetargs:"C:\workspace\Extensions\Extensions\ExtensionTests\bin\Debug\ExtensionsTests.dll -result=TestResult.xml;format=nunit2" -filter:+
Executing: C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe
NUnit Console Runner 3.8.0
Copyright (c) 2018 Charlie Poole, Rob Prouse
Runtime Environment
OS Version: Microsoft Windows NT 6.3.9600.0
CLR Version: 4.0.30319.42000
Test Files
C:\workspace\Extensions\Extensions\ExtensionTests\bin\Debug\ExtensionsTests.dll
Run Settings
DisposeRunners: True
WorkDirectory: c:\workspace\Extensions
ImageRuntimeVersion: 4.0.30319
ImageTargetFrameworkName: .NETFramework,Version=v4.6.1
ImageRequiresX86: False
ImageRequiresDefaultAppDomainAssemblyResolver: False
NumberOfTestWorkers: 2
Test Run Summary
Overall result: Passed
Test Count: 37, Passed: 37, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
Start time: 2018-02-23 10:40:58Z
End time: 2018-02-23 10:40:59Z
Duration: 1.106 seconds
Results (nunit2) saved as TestResult.xml
Committing...
No results, this could be for a number of reasons. The most common reasons are:
1) missing PDBs for the assemblies that match the filter please review the
output file and refer to the Usage guide (Usage.rtf) about filters.
2) the profiler may not be registered correctly, please refer to the Usage
guide and the -register switch.
I have tried setting the Jenkins to run under my ID and allowed it to interact with the desktop.
Can someone point me in the right direction to get it running please?
Ahh so I found the answer from this question, I just needed to move a quote to give:
"C:\Program Files (x86)\OpenCover\OpenCover.Console.exe" -register:user -target:"C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" -"targetargs:C:\workspace\Extensions\Extensions\ExtensionTests\bin\Debug\ExtensionsTests.dll -result=TestResult.xml;format=nunit2" -filter:+
Which works!

Creating setup for SQL Server 2008 Express with WIX

The command below runs successfully on the command line but when I put it to Wix Bootstrapper project it gives me an error.
The code that I run on command line is
setup.exe /ACTION=INSTALL /Q /ISSVCPASSWORD="password6161*"
/RSSVCPASSWORD="password6161*" /SAPWD="password6161*"
/INSTANCENAME="aaa5554" /SECURITYMODE="SQL"
/ConfigurationFile=ConfigurationFile.INI
The code that I write into the Wix
<Chain DisableSystemRestore="yes">
<PackageGroupRef Id="SqlServerExpress"/>
</Chain>
<?define InstanceName = "HyperionSSSS321312" ?>
<PackageGroup Id="SqlServerExpress">
<ExePackage Id="Sql2008Express"
DisplayName="SQL Server 2008 Express"
Cache="no"
Compressed="no"
PerMachine="no"
Permanent="no"
Vital="yes"
Name="Package\SqlServer\setup.exe"
SourceFile="Package\SqlServer\setup.exe"
InstallCommand="/ACTION=INSTALL /Q /ISSVCPASSWORD=test* /RSSVCPASSWORD=test* /SAPWD=test* /INSTANCENAME=$(var.InstanceName) /INSTANCEID=$(var.InstanceName) /SECURITYMODE=SQL /ConfigurationFile=ConfigurationFile.INI"
UninstallCommand="/Action=Uninstall /INSTANCENAME=$(var.InstanceName) /FEATURES=SQL /Q /HIDECONSOLE">
<ExitCode Value ="3010" Behavior="forceReboot" />
</ExePackage>
</PackageGroup>
When I run the setup file that Wix produced for me it fails
The log is below
1AC:32FC][2014-05-23T17:48:29]w321: Skipping dependency registration on package with no dependency providers: Sql2008Express
[11AC:32FC][2014-05-23T17:48:29]i000: Setting string variable 'WixBundleLog_Sql2008Express' to value 'C:\Users\BARIS~1.VEL\AppData\Local\Temp\SetupBoot_20140523174827_0_Sql2008Express.log'
[11AC:32FC][2014-05-23T17:48:29]i000: Setting string variable 'WixBundleRollbackLog_Sql2008Express' to value 'C:\Users\BARIS~1.VEL\AppData\Local\Temp\SetupBoot_20140523174827_0_Sql2008Express_rollback.log'
[11AC:32FC][2014-05-23T17:48:29]i201: Planned package: Sql2008Express, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: Yes, dependency: None
[11AC:32FC][2014-05-23T17:48:29]i207: Planned related bundle: {c1dddf1e-71bd-4847-b7c6-161cb0096f1a}, type: Upgrade, default requested: None, ba requested: None, execute: None, rollback: None, dependency: None
[11AC:32FC][2014-05-23T17:48:29]i299: Plan complete, result: 0x0
[11AC:32FC][2014-05-23T17:48:29]i300: Apply begin
[11AC:32FC][2014-05-23T17:48:29]i000: Caching bundle from: 'C:\Users\BARIS~1.VEL\AppData\Local\Temp\{19453c37-f078-45d3-939a-92a23e74184d}\.be\SetupBoot.exe' to: 'C:\Users\baris.velioglu\AppData\Local\Package Cache\{19453c37-f078-45d3-939a-92a23e74184d}\SetupBoot.exe'
[11AC:32FC][2014-05-23T17:48:29]i320: Registering bundle dependency provider: {19453c37-f078-45d3-939a-92a23e74184d}, version: 1.0.0.0
[11AC:1390][2014-05-23T17:48:29]i338: Acquiring package: Sql2008Express, payload: Sql2008Express, copy from: D:\EAE_Automation\EAE_Automation\EAE_Automation\SetupBoot\bin\Debug\Package\SqlServer\setup.exe
[11AC:1390][2014-05-23T17:48:29]i000: Setting string variable 'WixBundleLastUsedSource' to value 'D:\EAE_Automation\EAE_Automation\EAE_Automation\SetupBoot\bin\Debug\'
[11AC:1390][2014-05-23T17:48:29]i305: Verified acquired payload: Sql2008Express at path: C:\Users\baris.velioglu\AppData\Local\Package Cache\.unverified\Sql2008Express, moving to: C:\Users\baris.velioglu\AppData\Local\Package Cache\7E1E6EE9199D5AFD8117B8385E59B8EAAE724D2C\Package\SqlServer\setup.exe.
[11AC:32FC][2014-05-23T17:48:29]i301: Applying execute package: Sql2008Express, action: Install, path: C:\Users\baris.velioglu\AppData\Local\Package Cache\7E1E6EE9199D5AFD8117B8385E59B8EAAE724D2C\Package\SqlServer\setup.exe, arguments: '"C:\Users\baris.velioglu\AppData\Local\Package Cache\7E1E6EE9199D5AFD8117B8385E59B8EAAE724D2C\Package\SqlServer\setup.exe" /ACTION=INSTALL /Q /ISSVCPASSWORD=enerji2014* /RSSVCPASSWORD=enerji2014* /SAPWD=enerji2014* /INSTANCENAME=HyperionSSSS321312 /INSTANCEID=HyperionSSSS321312 /SECURITYMODE=SQL /ConfigurationFile=ConfigurationFile.INI'
[11AC:32FC][2014-05-23T17:48:29]e000: Error 0x84c4000e: Process returned error: 0x84c4000e
[11AC:32FC][2014-05-23T17:48:29]e000: Error 0x84c4000e: Failed to configure per-user EXE package.
[11AC:32FC][2014-05-23T17:48:29]i319: Applied execute package: Sql2008Express, result: 0x84c4000e, restart: None
[11AC:32FC][2014-05-23T17:48:29]e000: Error 0x84c4000e: Failed to execute EXE package.
[11AC:32FC][2014-05-23T17:48:29]i351: Removing cached package: Sql2008Express, from path: C:\Users\baris.velioglu\AppData\Local\Package Cache\7E1E6EE9199D5AFD8117B8385E59B8EAAE724D2C\
[11AC:32FC][2014-05-23T17:48:29]i330: Removed bundle dependency provider: {19453c37-f078-45d3-939a-92a23e74184d}
[11AC:32FC][2014-05-23T17:48:29]i352: Removing cached bundle: {19453c37-f078-45d3-939a-92a23e74184d}, from path: C:\Users\baris.velioglu\AppData\Local\Package Cache\{19453c37-f078-45d3-939a-92a23e74184d}\
[11AC:32FC][2014-05-23T17:48:29]i399: Apply complete, result: 0x84c4000e, restart: None, ba requested restart: No

Why does OpenProcessToken fail with ERROR_ACCESS_DENIED

I'm running a process as a user in the Administrators group, trying to get a process token for another process. The other process is run by a user not in the Administrators group. Here's the gist of the code I'm using. pid in this code represents the process id of the non-admin process. All of this is on Windows XP SP 2 and all on the same machine. No remote access going on here.
HANDLE handle;
HANDLE token;
handle = OpenProcess(PROCESS_QUERY_INFORMATION,FALSE,pid);
token = NULL;
OpenProcessToken(handle,TOKEN_DUPLICATE,&token);
Reference for OpenProcess here: http://msdn.microsoft.com/en-us/library/ms684320%28VS.85%29.aspx
Reference for OpenProcessToken here: http://msdn.microsoft.com/en-us/library/aa379295%28VS.85%29.aspx
OpenProcess succeeds, but no matter what I pass for the DesiredAccess argument to OpenProcessToken, it fails and GetLastError() return ERROR_ACCESS_DENIED. I added some code to understand the privileges of the process running this code and to enable as many as possible, as well as to gather information about the process I'm trying to get a token for. That involved requesting more access (READ_CONTROL | ACCESS_SYSTEM_SECURITY in addition to PROCESS_QUERY_INFORMATION) from OpenProcess and calling GetKernelObjectSecurity(handle). Here's what I've got:
current user: PLEASE_T\dbyron (S-1-5-21-3405506234-1792454352-3826119157-1005)
current process: group 0: flags: 0x00000007 sid: S-1-5-21-3405506234-1792454352-3826119157-513 (PLEASE_T\None)
current process: group 1: flags: 0x00000007 sid: S-1-1-0 (\Everyone)
current process: group 2: flags: 0x0000000F sid: S-1-5-32-544 (BUILTIN\Administrators)
current process: group 3: flags: 0x00000007 sid: S-1-5-32-545 (BUILTIN\Users)
current process: group 4: flags: 0x00000007 sid: S-1-5-4 (NT AUTHORITY\INTERACTIVE)
current process: group 5: flags: 0x00000007 sid: S-1-5-11 (NT AUTHORITY\Authenticated Users)
current process: group 6: flags: 0xC0000007 sid: S-1-5-5-0-91553 (no account mapping)
current process: group 7: flags: 0x00000007 sid: S-1-2-0 (\LOCAL)
SeDebugPrivilege privilege enabled
SeTakeOwnershipPrivilege privilege enabled
SeSecurityPrivilege privilege enabled
SeChangeNotifyPrivilege privilege enabled
SeBackupPrivilege privilege enabled
SeRestorePrivilege privilege enabled
SeSystemtimePrivilege privilege enabled
SeShutdownPrivilege privilege enabled
SeRemoteShutdownPrivilege privilege enabled
SeDebugPrivilege privilege enabled
SeSystemEnvironmentPrivilege privilege enabled
SeSystemProfilePrivilege privilege enabled
SeProfileSingleProcessPrivilege privilege enabled
SeIncreaseBasePriorityPrivilege privilege enabled
SeLoadDriverPrivilege privilege enabled
SeCreatePagefilePrivilege privilege enabled
SeIncreaseQuotaPrivilege privilege enabled
SeUndockPrivilege privilege enabled
SeManageVolumePrivilege privilege enabled
SeImpersonatePrivilege privilege enabled
SeCreateGlobalPrivilege privilege enabled
I've tried to get every privilege possible, and I think the group information above shows that the process calling OpenTokenProcess is a member of the Administrators group.
Here's the information from GetKernelObjectSecurity:
control(SE_DACL_PRESENT | SE_SELF_RELATIVE, 0x00008004)
owner sid: S-1-5-21-3405506234-1792454352-3826119157-2807 (PLEASE_T\dummyusr)
group sid: S-1-5-21-3405506234-1792454352-3826119157-513 (PLEASE_T\None)
grant: mask(PROCESS_ALL_ACCESS, 0x001F0FFF), flags(0x00000000): S-1-5-21-3405506234-1792454352-3826119157-2807 (PLEASE_T\dummyusr)
grant: mask(PROCESS_ALL_ACCESS, 0x001F0FFF), flags(0x00000000): S-1-5-32-544 (BUILTIN\Administrators)
grant: mask(PROCESS_ALL_ACCESS, 0x001F0FFF), flags(0x00000000): S-1-5-18 (NT AUTHORITY\SYSTEM)
So it appears that the dummyusr (non-admin) process allows access to the Administrators group. It's possible I'm misinterpreting the So why does OpenProcessToken fail with ERROR_ACCESS_DENIED? I've tried changing TOKEN_DUPLICATE to TOKEN_QUERY but that doesn't change the result.
Am I missing a privilege? What else would deny me access to an access token for this process? I've tried this on a machine with no anti virus software and still I get the same result.
I also tried this running in system context. The info about the current process in that case is:
current user: NT AUTHORITY\SYSTEM (S-1-5-18)
current process: group 0: flags: 0x0000000E sid: S-1-5-32-544 (BUILTIN\Administrators)
current process: group 1: flags: 0x00000007 sid: S-1-1-0 (\Everyone)
current process: group 2: flags: 0x00000007 sid: S-1-5-11 (NT AUTHORITY\Authenticated Users)
Note that the flags are slightly different for the BUILTIN\Administrators group. The administrator process had 0xF and the system process had 0xE. From http://msdn.microsoft.com/en-us/library/aa379624%28VS.85%29.aspx, the 0x1 bit means SE_GROUP_MANDATORY which doesn't seem relevant here.
By default the system context process also had some additional privileges:
SeAuditPrivilege
SeCreatePermanentPrivilege
SeLockMemoryPrivilege
SeTcbPrivilege
But I disabled them all and OpenProcessToken still succeeded in the system context process.
Thanks for your help.
Instead of going into details head first, have you gone down the route of elimination ? -- run the process as LOCAL_SYSTEM and see if that does the trick. After all if God can't do it then no one can :P.
I guess that the SECURITY_DESCRIPTOR of the targeted process only allow the SYSTEM user to open his process token.
This would mean sadly that there's nothing you can do.
yes there is a solution you can run a service or an instance of your app as service. this way you will get your code running as system....
Another option (but more intrusive) since you are already admin, is to change the target process acl....

Resources