Jump to content

setupcomplete.cmd problem


Recommended Posts

I need to know why doesn't

copy "%systemdrive%\install\TotalCommander\wincmd.ini" "%programfiles(x86)%\totalcmd\wincmd.ini" /Y

this 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?

Link to comment
Share on other sites


You can try like this:


@echo off
REM if not exist totalcmd folder
MKDIR "%systemdrive%\Program Files (x86)\totalcmd"
COPY /Y "%systemdrive%\install\TotalCommander\wincmd.ini" "%systemdrive%\Program Files (x86)\totalcmd\"
exit

Adapt to your needs the batch file, if the folder "totalcmd" exists or not!

Edited by myselfidem
Link to comment
Share on other sites

Well, the folder definitely does exist cause the **** app is being installed about 1 minute prior to setupcomplete.cmd :D

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.

Link to comment
Share on other sites

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 by iamtheky
Link to comment
Share on other sites

Well, the folder definitely does exist cause the **** app is being installed about 1 minute prior to setupcomplete.cmd :D

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 by myselfidem
Link to comment
Share on other sites

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.html

Well, is it possible to put simple pause command at the end of setupcomplete.cmd? If not I have no way to notice any errors :(

Link to comment
Share on other sites

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 by myselfidem
Link to comment
Share on other sites

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 by TheWalrus
Link to comment
Share on other sites

or have setupcomplete consist of

wpeinit
installtcmd.bat

i 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.

Link to comment
Share on other sites

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).aspx

You 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 by myselfidem
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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\"). :rolleyes:

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...