Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


Sign in to follow this  
kal

Detect AppsRoot.txt properly

Recommended Posts

To know my cdrom drive letter during my unattended installation, i used this trick during specialize pass :

<RunSynchronousCommand wcm:action="add">
<Description>Detect CDROM</Description>
<Order>10</Order>
<Path>cmd /c "FOR %i IN (C D E F G H I J K L N M O P Q R S T U V W X Y Z) DO IF EXIST %i:\AppsRoot.txt SETX AppsRoot %i: -m"</Path>
</RunSynchronousCommand>

By the way, I had an error dialog box while it was detecting AppsRoot :

errormj8.th.png

I had this error dialog box only on my main computer, not on my laptop. It's because my LCD Monitor has a memory stick/usb flash reader. Drive letters exists but there's no disk inside and it throws an exception (it should not, but it throws it).

So I Wrote a little .NET program (AppsRoot.exe) to detect AppsRoot.txt and set AppsRoot environment variable. Because it's written in low level, I can manage exceptions so there won't be error dialog box anymore and my unattended installation will stay unattended.

Here is how I use it, in specialize pass :

		<RunSynchronousCommand wcm:action="add">
<Description>Detect CDROM</Description>
<Order>10</Order>
<Path>cmd /c %systemroot%\setup\scripts\AppsRoot.exe</Path>
</RunSynchronousCommand>

And that's it! At first logon, you'll have your AppsRoot environment variable set correctly.

I've joined the executable AppsRoot.exe and its source in C# 2.0.

Hope it could help,

Kal

AppsRoot.exe

AppsRoot_SRC.rar

Edited by kal

Share this post


Link to post
Share on other sites

Hello kal!

Great input and great work! That's highly appreciated! :thumbup

You're 100% right. It can happen like you've described, even if in very less cases only.

My very first German Vista Guide was using an exe-file a member of German windows-unattended.de has written. It's called FWDT.exe and it is almost doing the same like your AppsRoot.exe.

The "problem" of this exe solution is, that you have to find a way to copy the AppsRoot.exe over to the target drive to execute it. That means you've to integrate to install.wim or you have to use $OEM$ folder and UseConfigSet - what has a known issue, too. Many users found it to complicated and so I switched back to the simple method you've mentioned first. As far as I've got feedback the simple method is working in about 99% of setups.

Don't missunderstand... I don't want to criticise, cause I know that your solution is the 100% perfect way of doing it and you did great work!

Thanks!

Regards,

Martin

Edited by FireGeier

Share this post


Link to post
Share on other sites

Thank you FireGeier!

Your unattended guide is highly appreciated too! That's where I learned everything (with WAIK Doc).

As you said, this solution implies to run AppsRoot.exe from target SystemRoot, not from the DVD. I put AppsRoot.exe in VistaWork\DVD\SOURCES\$OEM$\$$\SETUP\SCRIPTS and then i can run it from specialize pass like explained in first post. I didn't use UseConfigSet (I don't know what it is). By the way, I don't see where it's a problem to put that file on target drive ;)

The best way would be to launch AppsRoot.exe from DVD, so I will use GetCurrentDirectory() method to get CDROM drive letter. But I still didn't found a way to launch it from DVD, so i'm using an AppsRoot.txt file to recognize my cdrom.

Thank you for your answer. You can use/distrib AppsRoot.exe in your guide if you need.

Regards,

Kal

Edited by kal

Share this post


Link to post
Share on other sites

Hello kal!

I put AppsRoot.exe in VistaWork\DVD\SOURCES\$OEM$\$$\SETUP\SCRIPTS and then i can run it from specialize pass like explained in first post.

Ah... I forgot about this simple way of doing it. Than you will not have any problem usualy.

I didn't use UseConfigSet (I don't know what it is). By the way, I don't see where it's a problem to put that file on target drive newwink.

Well there is no problem, if you copy a file to the target system generaly, but if you use UseConfigSet tag in Autounattend.xml, than you will have the problem described here.

If you do it in an other way, than you'll have no problems - or better, you should not have. :sneaky:

You can use/distrib AppsRoot.exe in your guide if you need.

Thanks, I'll add that as a workaround, if the "simple" method should not work.

Regards,

Martin

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...