Page 1 of 2

**Dialog pop-up box after Install**

Posted: 03 Jun 2012 20:46
by SuzyQJax
:================================================================+
@echo off &cls mode con:cols=75 lines=20

for /f "delims=" %%x in ('dir /b *.exe') do set setup=%%x
"%setup%" /S /VERYSILENT /HIDE /SUPPRESSMSGBOXES=%CD%

taskkill /f /im XviD-Dec.exe>nul
:================================================================+

Ok guys sure there is something simple I am missing.. :roll:

when I run a silent install from command-line my .exe installs but
it pop-ups a confirm box to click OK and the batch stalls out.
I added the taskkill but it wont go to the next line of my batch.


Please help,
Thanks! SuzyQ

Re: **Dialog pop-up box after Install**

Posted: 03 Jun 2012 21:53
by Fawers
/SUPPRESSMSGBOXES=%CD%

What on Earth is that? Why is the current directory the value for "supressmsgboxes"?

Re: **Dialog pop-up box after Install**

Posted: 04 Jun 2012 00:20
by foxidrive
SuzyQJax wrote:when I run a silent install from command-line my .exe installs but
it pop-ups a confirm box to click OK and the batch stalls out.
I added the taskkill but it wont go to the next line of my batch.


You will need to disable the confirmation box with a switch, if there is one.

Or use this so they run concurrently. You will still need to deal with the confirmation box.

start "" "%setup%" ....

Re: **Dialog pop-up box after Install**

Posted: 04 Jun 2012 04:02
by SuzyQJax
Foxi your the Man!! :P

Or use this so they run concurrently. You will still need to deal with the confirmation box.
start "" "%setup%" ....


There was no switch to disable the box, and the supressmsgbox switch would not work
either but your start "" worked! and then went to my taskkill line which does kills the pop-up box.

Foxi, could you explain Why the start "" would allow this??

Code: Select all

:install
for /f "delims=" %%x in ('dir /b *.exe') do set setup=%%x
start "" "%setup%" /S /VERYSILENT /HIDE /SUPPRESSMSGBOXES=%CD%
:kill confirm box
taskkill /f /im XviD-Dec.exe>nul


Suzy :wink:

Re: **Dialog pop-up box after Install**

Posted: 04 Jun 2012 04:16
by foxidrive
Your switch below looks odd. I am not sure that it's set correctly.

/SUPPRESSMSGBOXES=%CD%



Start "" allows all the %setup% programs to run in another process and the batch file can continue.

Re: **Dialog pop-up box after Install**

Posted: 04 Jun 2012 04:23
by SuzyQJax
Fawers .. FYI

What on Earth is that? Why is the current directory the value for "supressmsgboxes"?


1.I know my script may be a little over the top but it does not require a file name for my .exe
2.The Supressmsgbox switch is from http://silentswitch.wordpress.com/a/
3.and CD because once everything in my directory is working I will then create a SelF eXtracting
(SFX) Archive File using WinRAR or 7-Zip for my silent unattended install.

My new working code:

Code: Select all

for /f "delims=" %%x in ('dir /b *.exe') do set setup=%%x
start "" "%setup%" /S /VERYSILENT=%CD%
taskkill /f /im XviD-Dec.exe>nul

Re: **Dialog pop-up box after Install**

Posted: 04 Jun 2012 04:36
by foxidrive
SuzyQJax wrote:2.The Supressmsgbox switch is from http://silentswitch.wordpress.com/a/


It is not listed on that page with =%cd%


Your code will fail on a slower machine as the task will be killed before it finishes. You need a delay before the taskkill.

Re: **Dialog pop-up box after Install**

Posted: 04 Jun 2012 05:33
by SuzyQJax
My bad Foxi.. The =%CD% is listed on this site since my .exe is a NSIS installer.
[url][http://code.google.com/p/windows-package-manager/wiki/InstallationScripts
/url]

My finished Install.cmd WORKING Code that I made into a sfx file using winrar...

Code: Select all

:info
:Installs Nic's XviD Decoder for Windows 7

:install
for /f "delims=" %%x in ('dir /b *.exe') do set setup=%%x
start "" "%setup%" /S /VERYSILENT=%CD%

:kill pop-up
taskkill /f /im XviD-Dec.exe>nul

:clean install files from temp folder
set DataDir=%userprofile%\appdata\local\temp
del /q/s/f "%DataDir%">nul&rd /s/q "%DataDir%">nul 2>&1
md "%DataDir%">nul 2>&1

:register
set DataDir=%windir%\SysWOW64
regsvr32 /s xvid.ax
set DataDir=%windir%\System32
regsvr32 /s xvid.ax

:refresh desktop with 2-sec delay
taskkill /f /im explorer.exe>nul
ping -n 2 127.0.0.1 >nul
start explorer.exe

exit


Thanks for all your help ... :wink:

Re: **Dialog pop-up box after Install**

Posted: 04 Jun 2012 05:41
by foxidrive
You have made an error. =%cd% should not be at the end of those switches and it may have stopped /SUPPRESSMSGBOXES from working.

Re: **Dialog pop-up box after Install**

Posted: 04 Jun 2012 06:18
by SuzyQJax
Foxi I revised my code with a delay as you suggested...
Your code will fail on a slower machine as the task will be killed before it finishes. You need a delay before the taskkill.


:install
start "" XviD-Dec.exe /S /VERYSILENT

:delay 1 sec
ping -n 1 127.0.0.1 >nul

:kill pop-up
taskkill /f /im XviD-Dec.exe>nul

:clean temp folder
set DataDir=%userprofile%\appdata\local\temp
del /q/s/f "%DataDir%">nul&rd /s/q "%DataDir%">nul 2>&1
md "%DataDir%">nul 2>&1

:register
set DataDir=%windir%\SysWOW64
regsvr32 /s xvid.ax
set DataDir=%windir%\System32
regsvr32 /s xvid.ax

exit

Thanks!! :lol:

Re: **Dialog pop-up box after Install**

Posted: 04 Jun 2012 06:25
by foxidrive
The set commands below aren't doing anything AFAICS and you're just registering the file twice.

Code: Select all

:register
set DataDir=%windir%\SysWOW64
regsvr32 /s xvid.ax
set DataDir=%windir%\System32
regsvr32 /s xvid.ax

Re: **Dialog pop-up box after Install**

Posted: 04 Jun 2012 07:06
by SuzyQJax
foxi ..

since its on a 64-bit system it has a 64-bit .ax then the 32-bit
so both Codecs DO need to be registered.

Re: **Dialog pop-up box after Install**

Posted: 04 Jun 2012 07:22
by foxidrive
The trouble there is that using the set command doesn't do anything to change directories and you are registering the same file.

Re: **Dialog pop-up box after Install**

Posted: 04 Jun 2012 07:31
by SuzyQJax
Been using that set command for years and it has always worked ..
but If IMYFB then I could use:
regsvr32 /s "%windir%\syswow64\xvid.ax"
regsvr32 /s "%windir%\syswow64\xvid.ax"

Re: **Dialog pop-up box after Install**

Posted: 04 Jun 2012 07:32
by SuzyQJax
correction.. my bad

regsvr32 /s "%windir%\syswow64\xvid.ax"
regsvr32 /s "%windir%\system32\xvid.ax"