bat file question.

Forum for anything else which doesn't fit in the above forums. Site feedback, random talk, whatever, are welcome.
Post Reply
tymothy
Posts: 29
Joined: Fri Jul 25, 2008 8:25 am

bat file question.

Post by tymothy » Wed Oct 22, 2008 10:03 pm

I have been working for about a month to install ghost 2003 silently. I finally found out it can be done with a bat file. I can make the bat file.

Question is how do I do this. I have the cab file and msi installer for ghost 2003. I have the bat file. Now I am lost. How do I put the bat file and the cab file and the msi installer and make it work for nlite? A step by step would be helpful. Thank you much.

User avatar
ricktendo64
Posts: 3213
Joined: Mon May 22, 2006 12:27 am
Location: Honduras

Post by ricktendo64 » Wed Oct 22, 2008 10:28 pm

7zip the installer and bat together and use 7zip or winrar to make a silent switch installer

tymothy
Posts: 29
Joined: Fri Jul 25, 2008 8:25 am

Post by tymothy » Thu Oct 23, 2008 1:09 am

No luck. Here is what I did.

Created a text file and put this in notepad.

ECHO.
ECHO Installing Norton Ghost 2003
ECHO Please wait...
start /wait "%systemdrive%\install\Applications\ghost\install\Norton Ghost.msi" /qb

I then changed the .txt to .bat looks fine.

I took the msi installer, the data cab needed by the mis installer for Ghost 2003 and the bat file I made and placed in a folder.

I took all 3 files and draged them into winrar and checked the box make sfx. Winrar did this.

Now I have the sfx that winrar made. I used nlite addon maker I got from here. http://virtualltek.mgbr.net/inicial.php ... lang=en-us

Using nlite addon maker I converted the sfx with Nlite addon maker. Install failed.

What am I doing wrong. I know this can be done. Just can not seem to figure it out.

User avatar
5eraph
Site Admin
Posts: 4618
Joined: Tue Jul 05, 2005 9:38 pm
Location: Riverview, MI USA

Post by 5eraph » Thu Oct 23, 2008 1:44 am

I'll assume you're using @ECHO OFF at the beginning to hide the following ECHO command lines.

After removing the space in the file name, try using:

Code: Select all

START /WAIT "msiexec.exe NortonGhost.msi /qb"
Including the path to the MSI shouldn't be necessary if the BAT is in the same directory. Including the path to msiexec is not necessary because it can be found within %SystemRoot%\system32 through the %PATH% environment variable.

tymothy
Posts: 29
Joined: Fri Jul 25, 2008 8:25 am

Post by tymothy » Thu Oct 23, 2008 2:32 am

Honeltly someone else made the bat file. Not smart enough to make one yet.

Will try the new bat file see if that works. Just to double check.

ECHO.
ECHO Installing Norton Ghost 2003
ECHO Please wait...
START /WAIT "msiexec.exe NortonGhost.msi /qb"


Should work ok fine? Hope all the other steps I am doing is right? Im reallyl clueless. If the steps I am doing mentiond above is wrong PLEASE someone let me know. I sure apreciate all the help. This program is tough for a silent install.

User avatar
5eraph
Site Admin
Posts: 4618
Joined: Tue Jul 05, 2005 9:38 pm
Location: Riverview, MI USA

Post by 5eraph » Thu Oct 23, 2008 2:46 am

;)

Code: Select all

@ECHO OFF
ECHO.
ECHO Installing Norton Ghost 2003
ECHO Please wait...
START /WAIT "msiexec.exe NortonGhost.msi /qb"

tymothy
Posts: 29
Joined: Fri Jul 25, 2008 8:25 am

Post by tymothy » Thu Oct 23, 2008 3:03 am

Once again I thank you much.

Hope the steps I mentiond how I was making the sfx file with winrar then using the nlite tool to convert to a cab is right? If I am doing that wrong please let me know. This is tough.

tymothy
Posts: 29
Joined: Fri Jul 25, 2008 8:25 am

Post by tymothy » Thu Oct 23, 2008 3:16 am

Fiddle. Any idea what line I use for the run once command? I forgot to ask that one. Sorry. Im a real noob with this making my own silent install.

Would the silent install line go into the sfx file or the ini file ?

User avatar
bober101
Posts: 923
Joined: Thu Feb 08, 2007 8:49 pm
Location: canadia!

Post by bober101 » Thu Oct 23, 2008 12:43 pm

the ini file is only for the integrator,it adds ure files to i386/svcpack and ran at t13.

but you still could use it via entries.ini and have 1 bat file calling the .msi file in a folder within svcpack , but to make it 'cleaner' you should include it in ure sfx.

if i remember right , alot of symantec products have silent 'builders' or launchers within the disc's contents.

a very good source for info about package switches is
appdeploy
Last edited by bober101 on Thu Oct 23, 2008 8:47 pm, edited 1 time in total.
XP theme source patcher
patches/overwrites ure default xp visual resources

User avatar
bober101
Posts: 923
Joined: Thu Feb 08, 2007 8:49 pm
Location: canadia!

Post by bober101 » Thu Oct 23, 2008 1:06 pm

ok i re-red ure post and u want to make an runonceEx installer.
make a bat file with this in it:

Code: Select all

FOR %%i IN (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:\i386\svcpack\ure_sfx.exe SET CDROM=%%i:

SET PP=%CDROM%\i386\svcpack

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


REG ADD %KEY%\919 /VE /D "installing ghost 2003 silently" /f
REG ADD %KEY%\919 /V 1 /D "%PP%\ure_sfx.exe" /f
be sure to edit both 'ure_sfx.exe' in the code to match the name of the silent sfx you made,it is important that ure sfx is completely silent,or you could launch ure msi setup silently by editing the entry like so:

Code: Select all

   REG ADD %KEY%\919 /V 1 /D "%PP%\ghostfolder\ghost 2003.msi /qn" /f     
but id make a completely silent sfx and simply launch the exe without parameters.

once ure bat is done,drop it along with ure_sfx.exe in a folder called svcpack. outside of that folder create ure entries.ini files like so:

Code: Select all

[general]
builddate=2008/xx/xx
description=imaging/backup software
language=eng
title=ghost 2003 silent install addon
version=2003
website=

[EditFile]
I386\SVCPACK.INF,SetupHotfixesToRun,AddProgram

[AddProgram]
ure_batch_file.bat

once its done you can zip both Entries_ghost2k3.ini and svcpack in one archive and taking care to add in the name of the archive 'addon' so it gets picked up when searching for it with the integartor.
XP theme source patcher
patches/overwrites ure default xp visual resources

User avatar
ricktendo64
Posts: 3213
Joined: Mon May 22, 2006 12:27 am
Location: Honduras

Post by ricktendo64 » Fri Oct 24, 2008 7:39 pm

I made a couple of vids on silent switch making, it may help a bit (part 3 has a nice trick into making RunOnceEx SVCPACK addons)

http://www.wincert.net/forum/index.php?showtopic=4659

tymothy
Posts: 29
Joined: Fri Jul 25, 2008 8:25 am

Post by tymothy » Fri Oct 24, 2008 9:09 pm

I just want to say THANK YOU to all you guys and gals. I had given up. I tried and tried with no luck. Just thought I was not smart enough to figure it out.

Now that I have had time to make it back to this thread and see everyone trying to help gives me new hope to get this done.

I just hope you all understand. Its really not about the one program its about learning to do it. If that makes sense.

Gonna read through the information, and make this work. Or try anyway. Thank you all kindly.

Stay Tuned. :)

tymothy
Posts: 29
Joined: Fri Jul 25, 2008 8:25 am

Post by tymothy » Sat Oct 25, 2008 11:33 am

Well I just can not seem to get it to work. I have tried just about everything I know and can think of.

If someone smarter than me wants to make it I would so apreciate it. Just drop me a pm. I will upload the files to mediafire. If not thats cool to. I gave it my best. Just can not get it figured out. Thanks all for everything.

User avatar
bober101
Posts: 923
Joined: Thu Feb 08, 2007 8:49 pm
Location: canadia!

Post by bober101 » Sat Oct 25, 2008 11:38 am

well i just watched the video rick made and its pretty straightforward,and its less hassle than the way i proposed.
XP theme source patcher
patches/overwrites ure default xp visual resources

User avatar
ricktendo64
Posts: 3213
Joined: Mon May 22, 2006 12:27 am
Location: Honduras

Post by ricktendo64 » Sat Oct 25, 2008 12:54 pm

Just post your config.txt let us look at it

tymothy
Posts: 29
Joined: Fri Jul 25, 2008 8:25 am

Post by tymothy » Sat Oct 25, 2008 9:47 pm

Ok the latest news. I tried the .ini file with runbat.ini

Seems like nlite was not crazy about that. Would not let me do that.

Not sure what you mean by the config.txt?

I have 3 files that need to be in the install. the .msi installer, the setup.exe because the msi installer looks for it.

Then I have the data cab. The data cab is pretty much the entire program.

For whatever reason windows will can not find the bat file I made. I put it by itself in the svcpack folder. I put put it with the other 3 files in the sfx setup.

I know I said I gave up, that was the frustration. I probally wont.

You guys are trying hard to help me. Not gonna let ya down.

Will look at the video again. I must of missed something.

Once again whats the config.txt and how do I get that?? I am off to watch the video again.

tymothy
Posts: 29
Joined: Fri Jul 25, 2008 8:25 am

Post by tymothy » Sun Oct 26, 2008 12:34 pm

stay tuned. Geeking hard today. Got the .msi delt with orca. Now im gonna see if my edit will deal with the install. Had no idea just how much you can edit that little thing. Instead of all the garbage I used to get with register the program this and that. Well thats no more. Just a Flat install bar and all done. So far so good. Stay tuned.

Props for the video. Helped TONS. While allot to wrap your head around starting to get it. Tools are super cool. Love that right click find the silent switch program. Sweet. Im off to geek out, be back later.

tymothy
Posts: 29
Joined: Fri Jul 25, 2008 8:25 am

Post by tymothy » Mon Oct 27, 2008 9:08 am

This program just refuses to install. Not sure what the deal is. I have tried EVERYTHING I can think of. The batch file failed. No Ideas Left. Thank anyway to ya all.

User avatar
ricktendo64
Posts: 3213
Joined: Mon May 22, 2006 12:27 am
Location: Honduras

Post by ricktendo64 » Mon Oct 27, 2008 12:40 pm

You can zip the bat or cmd with the installer and run it that way

Code: Select all

RunProgram="hidcon:NameOfFile.bat"
Dont forget to do a Admin install of the MSI using Universal Extractor (extract to subdir)
Also if the installer fails during T-13 but works after you log in then use WPI for it or make a RunOnceEx svcpack addon

tymothy
Posts: 29
Joined: Fri Jul 25, 2008 8:25 am

Post by tymothy » Tue Oct 28, 2008 5:52 am

Yea I tried both seperate and zipping them together. Tried autoit as well. No luck. This silly program just does not wanna install silently.

I asked a member to give it a shot. They said they would try, never herd any more about it. They may have had the same kinda luck I did.

Went through the videos and have all the tools. I can make a silent installer for just about anything, Its just this one is a peta.

tymothy
Posts: 29
Joined: Fri Jul 25, 2008 8:25 am

Post by tymothy » Tue Oct 28, 2008 9:43 am

Ok, I have WAYYYYYY taken the wrong aproach. I found this site by accident.

http://service1.symantec.com/SUPPORT/gh ... enDocument

Then in my setup file I found setup.ini. Ok so I can edit it and make nortons install right just playing with that file. So right now I am trying diffrent things, So far no luck. Here is what I am trying now.

[Info]
Name=INTL
Version=2.0.2600.2
DiskSpace=8000 ;DiskSpace requirement in KB

[Startup]
CmdLine=Msiexec /i "c:\temp\symantec ghost.msi" /qb
Product=Norton Ghost
PackageName=Norton Ghost.msi
MsiVersion=2.0.2600.2
EnableLangDlg=N

[0x0409]
TITLE=Choose Setup Language
DESCRIPTION=Select the language for this installation from the choices below.
OK=OK
Cancel=Cancel
1100=Setup Initialization Error
1101=InstallShield Wizard
1102=%s Setup is preparing the InstallShield Wizard which will guide you through the program setup process. Please wait.
1103=Checking Operating System Version
1104=Checking Windows(R) Installer Version
1105=Configuring Windows Installer
1106=Configuring InstallShield
1107=Setup has completed configuring the Windows Installer on your system. The system needs to be restarted in order to continue with the installation. Please click Restart to reboot the system.
1108=InstallShield
1150=Setup has detected an incompatible version of\nWindows. Please click OK and relaunch setup on\nWindows 95, Windows NT 4.0 SP 6 with Service Pack 6 or later.
1151=Error writing to the temporary location
1152=Error extracting %s to the temporary location
1153=Error reading setup initialization file
1154=Installer not found in %s
1155=File %s not found
1156=Internal error in Windows Installer
1200=Restart
1603=General Windows Installer engine error. Increase DiskSpace requirement in Setup.ini and try again.
1201=Setup needs %lu KB free disk space in %s. Please free up some space and try again
1202=You do not have sufficient privileges to complete this installation for all users of the machine. Log on as administrator and then retry this installation
1203=Command line parameters:
1204=/L language ID
1205=/S silent mode
1206=/V parameters to MsiExec.exe
1207=Windows(R) Installer %s found. This is an older version of the Windows(R) Installer. Click OK to continue.
1208=ANSI code page for %s is not installed on the system and therefore setup cannot run in the selected language. Run the setup and select another language.
1604=This setup does not contain the Windows Installer engine (%s) required to run the installation on this operating system.

Thats the english part of the setup.ini file.

I then use nlite addon maker to make it. Still trying, Not sure if I should use the msi to make this or the exe. Will keep ya posted. Knowing my luck. Wont work.

User avatar
ricktendo64
Posts: 3213
Joined: Mon May 22, 2006 12:27 am
Location: Honduras

Post by ricktendo64 » Tue Oct 28, 2008 12:25 pm

If you are going to use the INI then you need to use the Setup.EXE. I see you already put the silent switches here:

Code: Select all

CmdLine=Msiexec /i "c:\temp\symantec ghost.msi" /qb 

tymothy
Posts: 29
Joined: Fri Jul 25, 2008 8:25 am

Post by tymothy » Tue Oct 28, 2008 2:50 pm

Rick. I THINK?? I FINALLY got the job done. One question for ya.

Can you install addons in the order you want??

Say if I wanted Ghost addon to install first can that be done with nlite and how??

The reason I ask. When Tried alone, windows will not give nortons time to setup before it moves along and finishes.

If I were to install Ghost first then it would have time to finish installing before windows finished installing.

Yea I also found out with that file I am now using, all you have to do is add the switch itself. /qn Right now I am using /passive. Works fine so far. Holding my breth. With complete quiet install, windows will finish the install before ghost gets done. Using passive switch to see the bar to make sure it gets done.

User avatar
DaRk MaDnEsS
Posts: 168
Joined: Fri Oct 10, 2008 4:15 pm
Location: Port Said,Egypt

Post by DaRk MaDnEsS » Tue Oct 28, 2008 5:07 pm

just try to add in the end of the bat file something like

PING 1.1.1.1 -n 1 -w 60000 >NUL

this should delay about 60 sec

and change the first 60 in 60000 to change time

tymothy
Posts: 29
Joined: Fri Jul 25, 2008 8:25 am

Post by tymothy » Tue Oct 28, 2008 8:50 pm

DaRk MaDnEsS wrote:just try to add in the end of the bat file something like

PING 1.1.1.1 -n 1 -w 60000 >NUL

this should delay about 60 sec

and change the first 60 in 60000 to change time

Would that work with the setup.ini file?? I got it to start installing then it does a roll back. So there forsure needs to be a delay. I am hopeing it can be done with the setup.ini file??

User avatar
ricktendo64
Posts: 3213
Joined: Mon May 22, 2006 12:27 am
Location: Honduras

Post by ricktendo64 » Tue Oct 28, 2008 9:09 pm

No with nLite you just place it last or after the installer you want it to go after

With the integrator it will add them in alphabetical or numerical order

Code: Select all

00_installer.exe
01_installer.exe
etc
etc

tymothy
Posts: 29
Joined: Fri Jul 25, 2008 8:25 am

Post by tymothy » Wed Oct 29, 2008 4:41 am

Ok. First I can not tell you guys how much I apreciate all your help. I have learned SOOOOO much.

I hope someone can help with that delay I need. First I know NOTHING about scripts. So, Here is the script I use for the program.

Also whats the diffrence between "winwait" and "winloop" ??

#region - setup install script - (Automated with WinWait functions)

Opt('TrayIconDebug', 1)
Opt('WinDetectHiddenText', 1)
Opt('WinTitleMatchMode', 4)

; Installer.
$executable = 'setup.exe'
; Show progess.
$splash = 0
; Default catagory folder in startmenu.
$group = ''
; New catagory to move the default folder into.
$catagory = ''
; Installation folder in Program Files.
$directory = ''

; Run the installer.
$pid = _Install()
If WinWait('', '', 60) Then
ControlClick('', '', '')
WinWait('', '')
ControlClick('', '', '')
WinWait('', '')
ControlClick('', '', '')
WinWait('', '')
ControlClick('', '', '')
WinWait('', '')
ControlClick('', '', '')
Else
_Abort()
EndIf
ProcessWaitClose($pid)

; Remove shortcuts.
If _MainShortcut('?.lnk') Then
; Relative to shortcut directories
; Remove Startmenu shortcuts
FileDelete('?.lnk')
FileDelete('?.lnk')
FileDelete('?.lnk')
FileDelete('?.lnk')
FileDelete('?.lnk')
; Remove other shortcuts
_Desktop('?.lnk')
_QuickLaunch('?.lnk')
EndIf

#endregion

Exit

#cs - Exitcodes
1 = _Install(): Installer not found
2 = _Abort(): Installer process closed and then Abort
3 = _Abort(): Abort only
-1 = _ProcessBlock(): Blocked processes not unblocked
#ce

Func _Install($path = 'Default')
; Run the installer in Default Script directory.
Dim $splash, $processblock
If $path = 'Default' Then $path = @ScriptDir
If StringRight($path, 1) <> '\' Then $path = $path & '\'
If StringInStr($executable, '\') Then $path = ''
If Not FileExists($path & $executable) Then Exit 1
If $processblock <> '' Then Call('_' & 'ProcessBlock')
If $splash Then _Splash('Installing:' & StringTrimRight(StringReplace(@ScriptName, '_', ' '), 4))
If StringRight($executable, 3) = 'msi' Then
Return Run(@SystemDir & '\msiexec /i "' & $path & $executable & '"')
Else
Return Run($path & $executable)
EndIf
EndFunc

Func _Abort()
; close process if exists then exit.
Dim $pid
If ProcessExists($pid) Then
ProcessClose($pid)
Exit 2
Else
Exit 3
EndIf
EndFunc

Func _Desktop($shortcut)
; Delete a Desktop shortcut.
If FileExists(@DesktopDir & '\' & $shortcut) Then
Return FileDelete(@DesktopDir & '\' & $shortcut)
ElseIf FileExists(@DesktopCommonDir & '\' & $shortcut) Then
Return FileDelete(@DesktopCommonDir & '\' & $shortcut)
EndIf
EndFunc

Func _MainShortcut($shortcut, $rename = '')
; Change working directory to correct StartMenu\Group directory.
Dim $group, $catagory, $splash
If $group = '' Then Return 0
If FileExists(@ProgramsDir & '\' & $group) Then
FileChangeDir(@ProgramsDir & '\' & $group)
ElseIf FileExists(@ProgramsCommonDir & '\' & $group) Then
FileChangeDir(@ProgramsCommonDir & '\' & $group)
Else
Return 0
EndIf
; Wait for main shortcut.
If $splash Then _Splash('Waiting for shortcuts')
For $i = 1 To 20
If FileExists($shortcut) Then ExitLoop
Sleep(500)
Next
If $splash Then _Splash('Cleaning up:' & StringTrimRight(StringReplace(@ScriptName, '_', ' '), 4))
; If catagory not assigned anything, then return.
If $catagory = '' Then Return 1
; Move the group folder into the catagory folder.
If FileChangeDir('..') And DirCopy($group, $catagory & '\' & $group, 1) Then
If DirRemove($group, 1) Then
; If optional rename parameter is used, then rename the group folder.
If $rename <> '' And FileChangeDir($catagory) Then
If DirCopy($group, $rename, 1) And DirRemove($group, 1) Then
Return FileChangeDir($rename)
EndIf
Else
Return FileChangeDir($catagory & '\' & $group)
EndIf
EndIf
EndIf
EndFunc

Func _QuickLaunch($shortcut)
; Delete a Quicklaunch shortcut.
Local $subdirs = 'Microsoft\Internet Explorer\Quick Launch'
If FileExists(@AppDataDir & '\' & $subdirs & '\' & $shortcut) Then
Return FileDelete(@AppDataDir & '\' & $subdirs & '\' & $shortcut)
ElseIf FileExists(@AppDataCommonDir & '\' & $subdirs & '\' & $shortcut) Then
Return FileDelete(@AppDataCommonDir & '\' & $subdirs & '\' & $shortcut)
EndIf
EndFunc

Func _Splash($text = '')
; Shows a small borderless splash message.
Dim $splash
If $splash Then
If $text Then
SplashTextOn('', $text, 500, 25, -1, 5, 1, '', 14)
Else
SplashOff()
EndIf
EndIf
EndFunc

Func _WinClose($title, $text = '')
; Close a window with further attempts.
For $i = 1 To 10
WinClose($title, $text)
If Not WinExists($title) Then Return 1
Sleep(500)
Next
EndFunc

Func OnAutoItStart()
; A 2nd script instance will exit.
If StringInStr($CMDLINERAW, '/dummy') Then Exit
If WinExists(@ScriptName & '_Interpreter') Then Exit
AutoItWinSetTitle(@ScriptName & '_Interpreter')
EndFunc

7yler
Posts: 4
Joined: Mon Sep 29, 2008 4:07 am

Post by 7yler » Wed Oct 29, 2008 5:18 am

Just an FYI ...

When using the START command and "" it sees the first "" as a title

START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
[/WAIT] [/B] [command/program][parameters]
tymothy wrote:START /WAIT "msiexec.exe NortonGhost.msi /qb"
therefore, you need to do

Code: Select all

START "Install" /WAIT "msiexec.exe NortonGhost.msi /qb"
But it looks like you have found many ways to do the same thing :)

Nice way to learn new things ;)

tymothy
Posts: 29
Joined: Fri Jul 25, 2008 8:25 am

Post by tymothy » Wed Oct 29, 2008 1:31 pm

Oh the things I have learned and still have left to learn. When its all said and done, I wanna be able to make my ownl nlite addon no matter how tough the install is gonna be. Ghost 2003 Was rough. My aproach was wrong. I learned so much by simple trial and error.

The programsm, that handy little tool Cmenue and the video's I think someone from here made, It was a 4 part job, Used nlite and windows defender as expamples, both exe and msi. I have just picked up TONS of usefull stuff.

The next thing I wanna learn is AutoIT which I am in the process of starting now.

Just hope someone can show me how to edit the script I posted. Bat files are cool, Just think scripts work tons better and be more able to customize.

While many may think I am jumping from Bat to autoit think I just never got the bat thing figured out. Sure I did.

Now I just wanna learn autoit and the script posted and if someone can help me edit it Is a Big step in learning it.

Tried the autoit forums. Hate that place. Some dude giving me grief about how I did not need the script, Bla, Bla, Bla.

User avatar
5eraph
Site Admin
Posts: 4618
Joined: Tue Jul 05, 2005 9:38 pm
Location: Riverview, MI USA

Post by 5eraph » Sat Nov 01, 2008 6:26 am

Forum maintenance - Thread moved from Update Pack Discussion.

Post Reply