Jump to content

Setupcomplete.cmd Help


Recommended Posts

Hello i am almost finished with my unatended windows 7 instalation disk. here is the last problem i got. I use the Setupcomplete.cmd to install application un the first login. here is the code. The only problem is that not all the applicatiuons are installed ( only office and AVG9 ) But if i run the commands manualy it work. I was able to do this on windows Xp but windows 7 give me alot of problems.

any help would be really apreciated.

cmdow @ /HID
@echo off
FOR %%i IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\CD.txt SET CDDRIVE=%%i:

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY% /V TITLE /D "Install Par Francis Gauthier" /f

REG ADD %KEY%\020 /VE /D "Winrar 3.9" /f
REG ADD %KEY%\020 /V 1 /D "%CDDRIVE%\Applications\Winrar 3.9\winrar-x64-390fr.exe /s" /f

REG ADD %KEY%\030 /VE /D "0ffice 2003" /f
REG ADD %KEY%\030 /V 1 /D "%CDDRIVE%\Applications\Office 2003\office2003sp3.exe" /f

REG ADD %KEY%\040 /VE /D "Adobe 9.2" /f
REG ADD %KEY%\040 /V 1 /D "%CDDRIVE%\Applications\Adobe 9.2\AdbeRdr920_fr_FR.exe /sAll /rs /l /msi"/qb-! /norestart ALLUSERS=1 EULA_ACCEPT=YES SUPPRESS_APP_LAUNCH=YES" /f

REG ADD %KEY%\050 /VE /D "Flash player" /f
REG ADD %KEY%\050 /V 1 /D "%CDDRIVE%\Applications\Flash player\flashaio.exe" /f

REG ADD %KEY%\060 /VE /D "Java 6 update 17 x64" /f
REG ADD %KEY%\060 /V 1 /D "%CDDRIVE%\Applications\Java 6 update 17 x64\jre-6u17-windows-i586-s.exe /s /v"/qn IEXPLORER=1 ADDLOCAL=ALL UPDATE=0" /f

REG ADD %KEY%\070 /VE /D "K-lite 544" /f
REG ADD %KEY%\070 /V 1 /D "%CDDRIVE%\Applications\K-lite 544\klcp_standard_unattended.bat" /f

REG ADD %KEY%\150 /VE /D "CD Burner XP" /f
REG ADD %KEY%\150 /V 1 /D "%CDDRIVE%\Applications\Cd burner xp\cdbxp_setup_4.2.7.1801.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-" /f

REG ADD %KEY%\999 /VE /D "AVG 9.0" /f
REG ADD %KEY%\999 /V 1 /D "%CDDRIVE%\Applications\AVG 9.0\avg_free_stf_eu_90_704a1756.exe /hide /no_welcome /REMOVE_FEATURE fea_AVG_SafeSurf /REMOVE_FEATURE fea_AVG_SafeSearch" /f

EndLocal

EXIT

Link to comment
Share on other sites

  • 2 weeks later...

Because two of your apps are actually working, I would say that it isn't a problem with you overall strategy for installation, by itself. Without looking at the way each item works, it is impossible to say what your problem is.

However, here are a few things that I would look into first:

  • Try using a batch file to put all of your commands into, and call the batch file as a RunOnce or RunOnceEx. If all the commands work when typed manually, then you will only have to troubleshoot the 'autostarting' of this one command, rather than each one. Another benefit to a batch file, is that you can specify wait times, inbetween each command. If MSIExec is busy when the next command starts, the second app trying to install wont have access to msiexec, and wont finish properly.
    Add lines for logs to your command lines, if they are available for your installer. This will give you more insight into what is happening as each command line is called.
    Check spaces. Try changing the paths on the executables to not include spaces. Especially when using a command line to enter registry keys, quotation marks can become very confusing, as to whether they will end up in the key, or if they will be interpreted as string separators at the time the reg add command was run.
    Check the registry entries before you reboot. This way, you can see if any of the entries aren't going into the registry as you had inteded. One, in particular, I notice that there are three double quotes in the line to install java. I am sure that this won't be interpreted as you have intended. On this note, you could also add an additional command for each app to install. Make this the exact same as the line you want to use to install, however, add 'echo' in front and '>>commandlog.txt' behind each command. This way, you will get a text file listing all of the command that were run. If it is a syntax error that is preventing your apps from installing, this will be the easiest way to see them.

Link to comment
Share on other sites

I find it strange that you say that two of the installations worked, because all of the install lines within your file were incorrect due to spaces in the path names and a lack of supporting double-quotations, (with escapes)

Here's an updated version:

@CMDOW @ /HID
SETLOCAL
FOR %%# IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%#:\CD.txt (SET CDDRIVE=%%# & GOTO INSTALL)
GOTO :EOF
:INSTALL
SET "KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx"
REG ADD %KEY% /V TITLE /D "Install Par Francis Gauthier" /f
REG ADD %KEY%\020 /VE /D "Winrar 3.9"
REG ADD %KEY%\020 /V 1 /D "\"%CDDRIVE%\Applications\Winrar 3.9\winrar-x64-390fr.exe\" /s"
REG ADD %KEY%\030 /VE /D "0ffice 2003"
REG ADD %KEY%\030 /V 1 /D "\"%CDDRIVE%\Applications\Office 2003\office2003sp3.exe\""
REG ADD %KEY%\040 /VE /D "Adobe 9.2"
REG ADD %KEY%\040 /V 1 /D "\"%CDDRIVE%\Applications\Adobe 9.2\AdbeRdr920_fr_FR.exe\" /sAll /rs /l /msi\"/qb-! /norestart ALLUSERS=1 EULA_ACCEPT=YES SUPPRESS_APP_LAUNCH=YES\""
REG ADD %KEY%\050 /VE /D "Flash player"
REG ADD %KEY%\050 /V 1 /D "\"%CDDRIVE%\Applications\Flash player\flashaio.exe\""
REG ADD %KEY%\060 /VE /D "Java 6 update 17 x64"
REG ADD %KEY%\060 /V 1 /D "\"%CDDRIVE%\Applications\Java 6 update 17 x64\jre-6u17-windows-i586-s.exe\" /s /v\"/qn IEXPLORER=1 ADDLOCAL=ALL UPDATE=0\""
REG ADD %KEY%\070 /VE /D "K-lite 544"
REG ADD %KEY%\070 /V 1 /D "\"%CDDRIVE%\Applications\K-lite 544\klcp_standard_unattended.bat\""
REG ADD %KEY%\150 /VE /D "CD Burner XP"
REG ADD %KEY%\150 /V 1 /D "\"%CDDRIVE%\Applications\Cd burner xp\cdbxp_setup_4.2.7.1801.exe\" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-"
REG ADD %KEY%\999 /VE /D "AVG 9.0"
REG ADD %KEY%\999 /V 1 /D "\"%CDDRIVE%\Applications\AVG 9.0\avg_free_stf_eu_90_704a1756.exe\" /hide /no_welcome /REMOVE_FEATURE fea_AVG_SafeSurf /REMOVE_FEATURE fea_AVG_SafeSearch"

Please note I've corrected only for coding errors, I've not looked at your switches etc.

Link to comment
Share on other sites

  • 1 month later...

@Haxelon

J have read your message, and I hope to give you some help.

I also use RunOnceEx method with Windows 7 succesfully. All programs you see here are installed succesfully.

I prefere copy the programs on the HDD for the installation and after I delete the folder "Install".

Here is my SetupComplete.cmd

SetupComplete.cmd

------------------------------------------------------------------

::TITLE Windows 7 Edition Intégrale 32 bits - Méthode RunOnceEx for silent install

REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnceEx

SET KEY=HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY% /V TITLE /D "Installation des applications" /f

REG ADD %KEY%\005 /VE /D "Activation Windows 7 Ultimate" /f

REG ADD %KEY%\005 /V 1 /D "%systemroot%\Setup\Scripts\active.vbs" /f

REG ADD %KEY%\010 /VE /D "Personnalisation Tweaks du registre" /f

REG ADD %KEY%\010 /V 1 /D "REGEDIT /S %systemroot%\Setup\Scripts\Tweaks.reg" /f

REG ADD %KEY%\015 /VE /D "Installation ATI Display Driver" /f

REG ADD %KEY%\015 /V 1 /D "%systemdrive%\Install\ATIDriver\Setup.exe -INSTALL" /f

REG ADD %KEY%\020 /VE /D "Installation Realtek R239" /f

REG ADD %KEY%\020 /V 1 /D "%systemdrive%\Install\Realtek\Setup.exe -s "-f1%systemdrive%\Install\Realtek\setup.iss"" /f

REG ADD %KEY%\025 /VE /D "Installation Office Standard 2007" /f

REG ADD %KEY%\025 /V 1 /D "%systemdrive%\Install\Office\SETUP.EXE /config %systemdrive%\Install\Office\STANDARDR.WW\CONFIG.XML" /f

REG ADD %KEY%\030 /VE /D "Installation JAVA SUN" /f

REG ADD %KEY%\030 /V 1 /D "%systemdrive%\Install\Java\jre-6u17-windows-i586-s.exe /s /v "/qn"" /f

REG ADD %KEY%\035 /VE /D "Installation Adobe Flash Player 10 ActiveX" /f

REG ADD %KEY%\035 /V 1 /D "%systemdrive%\Install\Flash\install_flash_player_10_active_x.exe /s" /f

REG ADD %KEY%\040 /VE /D "Installation Adobe Reader 9.2.0" /f

REG ADD %KEY%\040 /V 1 /D "%systemdrive%\Install\Adobe\AdbeRdr920_fr_FR.exe /sAll /rs" /f

REG ADD %KEY%\045 /VE /D "Installation Adobe Reader 9.2.0 eula" /f

REG ADD %KEY%\045 /V 1 /D "REGEDIT /S %systemroot%\Setup\Scripts\Adobe.reg" /f

REG ADD %KEY%\050 /VE /D "Installation TuneUp 2008 Key" /f

REG ADD %KEY%\050 /V 1 /D "REGEDIT /S %systemroot%\Setup\Scripts\TuneUp.reg" /f

REG ADD %KEY%\055 /VE /D "Installation TuneUp Utilities 2008" /f

REG ADD %KEY%\055 /V 1 /D "%systemdrive%\Install\TuneUp\TU2008TrialFR.exe /qn /norestart" /f

REG ADD %KEY%\060 /VE /D "Installation WinRar 390" /f

REG ADD %KEY%\060 /V 1 /D "%systemdrive%\Install\WinRar\wrar390fr.exe /S" /f

REG ADD %KEY%\065 /VE /D "Installation WinRar 390 Key" /f

REG ADD %KEY%\065 /V 1 /D "REGEDIT /S %systemroot%\Setup\Scripts\rarreg.key" /f

REG ADD %KEY%\070 /VE /D "Installation Movie Maker 2.6" /f

REG ADD %KEY%\070 /V 1 /D "msiexec.exe /i "%systemdrive%\Install\MovieMaker\MM26_FR.msi" /qn" /f

REG ADD %KEY%\075 /VE /D "Finalisation de l'installation" /f

REG ADD %KEY%\075 /V 1 /D "%systemroot%\Setup\Scripts\clean.vbs" /f

EXIT

---------------------------------------------------------------------------

You can see when you want install a msi file, you must use msiexec.exe.

I use two vbs scripts for hide the batch, you can tray it

Clean.vbs

--------------------------------------------

Set WshShell = WScript.CreateObject("WScript.Shell" )

WshShell.Run "%SystemRoot%\Setup\Scripts\clean.bat" ,SH_WIDE ,true

--------------------------------------------

Clean.bat

---------------------------------------------

@echo off

RMDIR /S /Q %systemdrive%\Install

EXIT

--------------------------------------------

Put all these scripts into the folder SCRIPTS.

You can see the attachment here.

Good luck!

Edited by myselfidem
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...