Commandline install MSI takes too long - command-line

For some reason trying to install a msi executable trough commandline takes too long or never completes. The program is unsigned themes for windows that allows you to run unsupported themes on windows. Its available from here: Download
Im trying to install the 64bit version with:
start /wait "UxStyle Core x64.msi"
The whole batch file looks like this:
#echo off
net stop uxsms
IF "%PROCESSOR_ARCHITECTURE%" == "AMD64" call :install64
IF "%PROCESSOR_ARCHITECTURE%" == "x86" call :install32
IF ERRORLEVEL 1 goto :UxStyleErr
takeown /f "%WINDIR%\Resources\Themes\Aero\aero.msstyles"
icacls "%WINDIR%\Resources\Themes\Aero\aero.msstyles" /grant %USERNAME%:F"
ren "%WINDIR%\Resources\Themes\Aero\aero.msstyles" aero.msstyles.original
copy /y aero.msstyles "%WINDIR%\Resources\Themes\Aero\"
net start uxsms
echo Installation completed. Press any key to reboot or close this dialog if you want to restart later.
pause
shutdown /r /t 0
goto :eof
:install64
start /wait "UxStyle Core x64.msi"
goto :eof
:install32
start /wait "UxStyle Core x86.msi"
goto :eof
:UxStyleErr
echo An error occured while installing UxStyle Core. Installation will now quit.
pause
goto :eof
What am i doing wrong?

Instead of using start /wait to launch the .msi file, I'd recommend calling msiexec.exe directly. You'll also be able to generate a log file which will help you diagnose what is going wrong. So I'd modify your start /wait commands to look like:
msiexec /i "UxStyle Core x64.msi" /l*v x64_installlog.txt
You can add /passive or /quiet to the command to show just a progress bar or run with absolutely no UI respectively.

Please read:
Msiexec (command-line options)
It looks like you are lacking the /QB or /QB switches to run without interaction. Also consider adding REBOOT=R to prevent them MSI from executing any unexpected reboots.

Related

How to run VSCode from Window Comand Script

I would like to run VSCode from Windows Command Script with options of extensions-dir and user-data-dir.
It is ok on Windows Command Prompt.
But it is failed on Windows Command Scripts.
I tried many ways but all failed.
These is codes I'm trying:
#echo off
setlocal
set VSCODE_DEV=
set ELECTRON_RUN_AS_NODE=1
set configpath=%~dp0..\extensions
set extensionpath=%~dp0..\settings
set exepath=%~dp0..\Code.exe
::"%~dp0..\Code.exe" "--extensions-dir=\"D:\Windows\Programs\VSCode\extensions\""
::"%~dp0..\Code.exe" "--user-data-dir=D:\Windows\Programs\VSCode\settings" %*
::"%~dp0..\Code.exe --extensions-dir=D:\Windows\Programs\VSCode\extensions --user-data-dir=D:\Windows\Programs\VSCode\settings" %*
start "" "" "%~dp0..\Code.exe" "--help" "--version" "%~dp0..\resources\app\out\cli.js" %*
::start /d %exepath% "--list-extensions"
::start /WAIT /B "D:\Windows\Programs\VSCode\Code.exe"
endlocal
Could someone tell me how to fix it?
Thank you all with kind regards!

Silent install of application with PowerShell

I'm working to automate the install of some of our software and was able to do so using a batch file, but was having issues with getting the silent install working in PowerShell.
The batch file which is working properly to install the application is:
#echo off
start /wait Setup.exe -s -l=EN
echo %errorlevel%
I've tried the following code in PowerShell, but the GUI installer will appear when I attempt to run it.
cmd.exe /c "Start /wait c:\temp\application\setup.exe -s -l=EN"
I don't receive any error messages when running the PowerShell script, it just doesn't install the application silently.
Try this:
&{ "c:\temp\application\setup.exe" -s -l=EN }
This should call an external Commandline command from Powershell.
The braces are not always strictly necessary either if you are just running the command and not doing anything with the output the following would likely work
& c:\temp\application\setup.exe -s -l=EN

Killing inactive form session through oracle application server

I am trying use host command in Oracle forms. I get the process id as input from the user and on clicking ok the form should kill the session related to process id.
PS: Users will be entering only frmweb.exe process id which are inactive.
cmd := 'CMD /C taskkill /F /FI /pid 'process which is got as input' /IM frmweb.exe';
host(cmd)
I also tried by writing the above command into a .bat file in application server.When trying to execute the bat file it din work. But when tryin to run the bat file by double clicking in Application server the session was killed.
On executing the above I am unable to kill the process.
I would also like to know whether the host command was successful or not.
Could you please help me and guide me in proceeding. Orakill and alter session are working but I don want to use it.
I tried with writing the command execution to a text for debugging and was able to find the solution.
cmd := 'CMD /C taskkill /F /FI /pid 'process which is got as input' /IM frmweb.exe>>output.txt';
There was some special character written in at the end of the command due to which the command was failing when calling from Oracle Forms.Special character was due to a typo in the code the Oracle Forms.

Command line NSIS script compilation - silent option

I would like to make my installer silent. I would like to have flexibility to make installer silent or not depending on a command line option. In doc, I have found this to launch NSIS script compilation:
"C:\Program Files\NSIS\makensis.exe" "D:\Produts\folder\Install\nsis\MyApp.nsi"
this is working. By default, this is generating a non silent installer. To have a silent installer (with a command line option only), i tried this
"C:\Program Files\NSIS\makensis.exe" \S "D:\Produts\folder\Install\nsis\MyApp.nsi"
but \S is not a recognized option. How can i make installer silent with command line option?
I can find this in doc
4.8.1.36 SilentInstall
normal|silent|silentlog Specifies whether or not the installer should
be silent. If it is 'silent' or 'silentlog', all sections that have
the SF_SELECTED flag are installed quietly (you can set this flag
using SectionSetFlags), with no screen output from the installer
itself (the script can still display whatever it wants, use
MessageBox's /SD to specify a default for silent installers). Note
that if this is set to 'normal' and the user runs the installer with
/S (case sensitive) on the command line, it will behave as if
SilentInstall 'silent' was used. Note: see also LogSet.
See section 4.12 for more information.
so that i feel abused
Or should some instruction be added to NSIS script, so that compilation is receptive to /S option ?
Tried it with -S and not working either.
Thanks and regards
/S option is available for your installer, not the makensis.exe. So you can run the installer in silent mode from commandline:
MyApp.exe /S
In case you want to build installer to be always silent, you can use following technique:
In the .onInit function:
Function .onInit
!ifdef IsSilent
SetSilent silent
!endif
FunctionEnd
And then build the installer with /D option to define the IsSilent constant:
makensis.exe /DIsSilent MyApp.nsi
That means, in case you build with /D option like above, the installer will be always silent; without /D option your installer will be non-silent by default and still you can run it from commandline MyApp.exe /S to be silent.
If you want to COMPILE the NSI script silently from a command line, that is not the same as having the installer run silently.
In my compile batch scripts, I use:
c:\progra~1\nsis\makensis /V0 .\sample.nsi | findstr /b /r /c:"YouCantFindMe"
The /V# option suppresses all output but still includes a ribbon/banner when the compiler starts (see NSIS command line option documentation. Piping all output through "findstr" suppresses that output as well.

Creating junctions in Windows for Hudson build

I have a job in Hudson that builds on a Windows XP slave. I know that symlinks are not possible (directly) in Windows XP, and so I am trying to use junctions instead. I wrote a batch script:
#echo off
if "%1" == "" goto ERROR1
if "%2" == "" goto ERROR2
goto create
:create
echo Creating junction for %1 at %2
if exist %2 junction -q -d %2
md %2
junction -q %2 %1
goto :eof
:ERROR1
echo Source directory not specified
goto :eof
:ERROR2
echo Destination directory not specified
goto :eof
In my job, when I call this script, it hangs at the line echo Creating junction for %1 at %2. This is my Hudson "Execute Windows Batch Command":
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x64
copy C:\Data\Scripts\slink.bat .
call slink.bat C:\Data\3rdParty64 3rdParty
call slink.bat %WORKSPACE%\..\..\..\tds.core\label\%label% tds.core
...and this is the output:
C:\Data\Hudson\dev\workspace\Common_Windows\label\DFWW9202>call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x64
Setting environment for using Microsoft Visual Studio 2010 x64 tools.
1 file(s) copied.
Creating junction for C:\Data\3rdParty64 at 3rdParty
Any ideas? (if this is not the right site, please redirect..sorry and thanks!)
The best way to solve this is to: pass /accepteula command-line argument to the junction command.
eg:
junction -q %2 %1 /accepteula
This procedure did not work for me, but I did narrow down the real problem.
Some background: The very first time the "junction.exe" program is ever run by a user on a Windows machine, it throws up an End User License Agreement (EULA) with an Agree button. Once that user clicks on the "Agree" button, they can use the utility normally.
junction.exe was stalling for Hudson because the service was being run as "Default User", and "Default User" never clicked on the Agree button. This caused junction.exe to invisibly and indefinitely stall, waiting for that click, which of course will never arrive.
The way we fixed it was to configure the system to run the Hudson service as a well known account, instead of as Default User. Then we logged into the Windows machine as that account, ran junction.exe, clicked on the Agree button, then logged off.
junction.exe has worked nicely in Hudson ever since.
The other option is to move to Windows Server 2008. I'm told that version has the junction functionality in a new "mklink" utility that comes built into the OS itself, and does not have a EULA.
Never mind, found it if anyone else is looking - I changed the "call" to slink.bat to "start /B", and added full paths, so:
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x64
start /B C:\Data\Scripts\slink.bat C:\Data\3rdParty64 3rdParty
start /B C:\Data\Scripts\slink.bat slink.bat %WORKSPACE%\..\..\..\tds.core\label\%label% tds.core