Octopuss Posted December 7, 2011 Posted December 7, 2011 I need to know why doesn'tcopy "%systemdrive%\install\TotalCommander\wincmd.ini" "%programfiles(x86)%\totalcmd\wincmd.ini" /Ythis line work. If I execute it from regular commandline it processes ok, but ran from setupcomplete.cmd it doesn't do jack. I install Total Commander with Firstlogoncommands silently and it works fine. This line is supposed to copy the configuration to the installation folder, but for some reason it never happens. When I check totalcmd folder there is the default generated .ini, but it's supposed to be overwritten by the one I have elsewhere. I also believe setupcomplete.cmd is executed last, so it shouldn't be overwritten. I assume it rather fails to get copied over.Any ideas?
myselfidem Posted December 7, 2011 Posted December 7, 2011 (edited) You can try like this:@echo offREM if not exist totalcmd folderMKDIR "%systemdrive%\Program Files (x86)\totalcmd"COPY /Y "%systemdrive%\install\TotalCommander\wincmd.ini" "%systemdrive%\Program Files (x86)\totalcmd\"exitAdapt to your needs the batch file, if the folder "totalcmd" exists or not! Edited December 7, 2011 by myselfidem
Octopuss Posted December 7, 2011 Author Posted December 7, 2011 Well, the folder definitely does exist cause the **** app is being installed about 1 minute prior to setupcomplete.cmd I am dying to find out what the problem is. I am using %programfiles% variable without problems in autounattend.xml to install stuff, so why wouldn't it work in here? The trouble is the errors that happen during the batch file being run are apparently not logged anywhere, so I can't even look at an error message and work from there.Of course using %systemdrive% probably should work, but I am trying to have the whole process as flexible as possible.Will test what you suggested in a VM and see.
iamtheky Posted December 7, 2011 Posted December 7, 2011 (edited) i suppose you could also:set programfiles(x86) = "%systemdrive%\program files (x86)"at the top of setupcomplete, and then proceed as you were (so that its logical for future additions). But i would certainly do a dry run where it echoes everything with the new variable you create for confirmation. There is also the registry recommendation here:http://911cd.net/forums//lofiversion/index.php/t804.html Edited December 7, 2011 by iamtheky
myselfidem Posted December 8, 2011 Posted December 8, 2011 (edited) Well, the folder definitely does exist cause the **** app is being installed about 1 minute prior to setupcomplete.cmd If you have some problem using SetupComplete.cmd you can add inside your Autounattend.xml a new Command for TotalCommander. Adapt to your needs.<FirstLogonCommands> <SynchronousCommand wcm:action="add"> <Description>Installing TotalCommander</Description> <CommandLine>cmd /c %systemdrive%\install\TotalCommander\tc80x64beta11.exe (your silent switches)</CommandLine> <Order>1</Order> <RequiresUserInput>false</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <Description>Customizing TotalCommander</Description> <CommandLine>cmd /c COPY /Y "%systemdrive%\install\TotalCommander\wincmd.ini" "%systemdrive%\Program Files (x86)\totalcmd\"</CommandLine> <Order>2</Order> <RequiresUserInput>false</RequiresUserInput> </SynchronousCommand> </FirstLogonCommands> Edited December 8, 2011 by myselfidem
Octopuss Posted December 9, 2011 Author Posted December 9, 2011 I tried that, only with regular " instead of the code. It didn't work either. Bleh.Of course the best would be somehow forcing the tcmd installer itself to use the customized configuration file, but I failed to google anything up.i suppose you could also:set programfiles(x86) = "%systemdrive%\program files (x86)"at the top of setupcomplete, and then proceed as you were (so that its logical for future additions). But i would certainly do a dry run where it echoes everything with the new variable you create for confirmation. There is also the registry recommendation here:http://911cd.net/for...x.php/t804.htmlWell, is it possible to put simple pause command at the end of setupcomplete.cmd? If not I have no way to notice any errors
myselfidem Posted December 9, 2011 Posted December 9, 2011 (edited) Could you share with us how do you install silently your TotalCommander file, first, and your Autounattend.xml file?At the end of the batch file you can use:>nul timeout /t 5 to add a pause: 5 means 5 seconds. But, if I remember you will see nothing than a black window, even if you add a pause (for n seconds)! Maybe you can use a batch file and not SetupComplete.cmd!*Edit: After testing TotalCommander (x64) on the Virtual Machine, I see that "wincmd.ini" is set to : %userprofile%AppData\Roaming\GHISLER\wincmd.ini. Maybe you changes the path for "wincmd.ini" during your installation?The problem is SetupComplete.cmd is launched first and after FirstLogonCommand! Edited December 9, 2011 by myselfidem
Octopuss Posted December 9, 2011 Author Posted December 9, 2011 (edited) How do you mean first? I thought it's AFTER firstlogoncommands!! (no idea why though, because firstLOGONcommands are pretty clear as for when that state takes place, lol) That would explain! I will recheck autounattend file for some sort of paths mistake.edit: talking about autounattend file, is it safe to run batch files by firstlogoncommands? I hate to add extra bunch of lines for copying one lousy file. Edited December 9, 2011 by TheWalrus
iamtheky Posted December 9, 2011 Posted December 9, 2011 or have setupcomplete consist ofwpeinitinstalltcmd.bati suppose first you would author installtcmd.bat that does this stuff with echoes and pauses so you can see whats going on, mount the wim and put that right next to setupcomplete.cmd.
myselfidem Posted December 9, 2011 Posted December 9, 2011 (edited) How do you mean first? I thought it's AFTER firstlogoncommands!! (no idea why though, because firstLOGONcommands are pretty clear as for when that state takes place, lol) That would explain! I will recheck autounattend file for some sort of paths mistake.http://technet.micro...314(WS.10).aspxYou cannot reboot the system and resume running SetupComplete.cmd.Setup does not verify any exit codes or error levels in the script after executing SetupComplete.cmd.The functionality of Setupcomplete.cmd differs from the RunSynchronous and RunAsynchronous commands in the following way: Setupcomplete.cmd runs after Windows Setup completes, while the RunSynchronous and RunAsynchronous commands run during Windows Setup.Note: When a computer joins a domain during installation, the Group Policy that is defined in the domain is not applied to the computer until Setupcomplete.cmd completes. This is to ensure that the Group-Policy configuration activity does not interfere with the script. Note: Commands in the Setupcomplete.cmd file are executed with local system privilege. After Windows is installed, but before the logon screen appears, Windows Setup searches for the SetupComplete.cmd file in the %WINDIR%\Setup\Scripts\ directory.If a SetupComplete.cmd file is found, the file is executed. Otherwise, installation continues normally. Windows Setup logs the action in the Setupact.log file.However I made a successful test using the correct path for "wincmd.ini" with Autounattend.xml file <FirstLogonCommands> <SynchronousCommand wcm:action="add"> <Order>1</Order> <Description>Password never expires</Description> <CommandLine>cmd /C wmic useraccount where "name='Paul'" set PasswordExpires=FALSE</CommandLine> <RequiresUserInput>false</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <Description>Installing TotalCommander</Description> <CommandLine>cmd /c %systemdrive%\Install\TotalCommander\tc80x64beta11.exe</CommandLine> <Order>2</Order> <RequiresUserInput>false</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <Description>Changing path</Description> <CommandLine>cmd /c copy /y "%systemdrive%\Install\TotalCommander\wincmd.ini" "%userprofile%\AppData\Roaming\GHISLER\"</CommandLine> <Order>3</Order> <RequiresUserInput>false</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <Description>Post Setup Installation with WPI</Description> <CommandLine>cmd /c %SystemDrive%\Install\FirstLog_x64.cmd</CommandLine> <Order>9</Order> <RequiresUserInput>false</RequiresUserInput> </SynchronousCommand> </FirstLogonCommands>http://www.msfn.org/board/topic/139150-working-unattendxml-and-applications-installs/page__view__findpost__p__894362 Edited December 9, 2011 by myselfidem
Octopuss Posted December 12, 2011 Author Posted December 12, 2011 Ah I know what confused me. I use the settings to auto log local administrator after setup finishes, but in fact setupcomplete.cmd runs last before the user gets logged on, which of course I can't see with the settings I use.It still doesn't work yet though, but it's a matter of syntax in the answer file I guess.Btw why do you use " in there? " works fine for me.
myselfidem Posted December 12, 2011 Posted December 12, 2011 (edited) Btw why do you use " in there? " works fine for me.With this example, it's not really needed to use quotes (" = ") because there is no folder names with empty spaces...But quotes will be needed if there is folder names with empty spaces: like my first example ("%systemdrive%\Program Files (x86)\totalcmd\"). Edited December 12, 2011 by myselfidem
Octopuss Posted December 13, 2011 Author Posted December 13, 2011 No, I mean is there any reason to use the code instead of simple quotes? " vs "
myselfidem Posted December 13, 2011 Posted December 13, 2011 Yes! Using quotes with Autounattend.xml file is writed: "When you use WSIM and save your customized Autounattend.xml file using quotes you will see that quotes (") are writed " when you read your file.
Octopuss Posted December 14, 2011 Author Posted December 14, 2011 But I don't use WSIM anymore and using quotes simply works, so I still don't understand the reason to use the code instead...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now