Jump to content

Recommended Posts

Posted

I want to change the default icon of the text files without hacking the shell32.dll.

So this is what I did.

Under the HKCR\txtfile\DefaultIcon, I manually changed the default value to the path of my icon file. In my case, it is "%SystemRoot%\Resources\Icons\txt.ico",0.

However, if I export that entry so I can use it on my unattended installation, the value changed to hex.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\txtfile\DefaultIcon]
@=hex(2):22,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,\
 00,25,00,5c,00,52,00,65,00,73,00,6f,00,75,00,72,00,63,00,65,00,73,00,5c,00,\
 49,00,63,00,6f,00,6e,00,73,00,5c,00,74,00,78,00,74,00,2e,00,69,00,63,00,6f,\
 00,22,00,2c,00,30,00,00,00

Is there a way to change this hex value to a more readable text? And I'm not sure if this will work on a different installation.

I tried

[HKEY_CLASSES_ROOT\txtfile\DefaultIcon]

@="%SystemRoot%\Resources\Icons\txt.ico",0

but it didn't work.


Posted

I think your first problem is this:

"%SystemRoot%\Resources\Icons\txt.ico",0

should be

"%SystemRoot%\Resources\Icons\txt.ico,0"

If you do it with an INF file you can read the value as plaintext rather than hex values..

[Version]
Signature = "$Windows NT$"

[DefaultInstall]
AddReg = Add.AddReg

[Add.AddReg]
HKCR,"txtfile\DefaultIcon","",0x00020000,"%SystemRoot%\Resources\Icons\txt.ico,0"

0x00020000 is REG_EXPAND_SZ (which isn't too readable when exported to a REG file)

Posted

Thanks guys for the reply. I'm gonna try them.

@MCT

What is it gonna look like if I use 2 percent signs? Is it like this?

@="%%SystemRoot%%\Resources\Icons\txt.ico",0

@pinout

The "%SystemRoot%\Resources\Icons\txt.ico",0 is actually the exact value in my registry. But I will try your idea.

I'm still a rookie in INF files. I don't even know how to use it for a silent installation. All I know is installing it manually. (right click an INF file, then click install. :lol: )

And I don't know how to make those kind of scripts.

Posted

@Totoymola

he made the inf for u :P

Rundll32.exe setupapi,InstallHinfSection DefaultInstall 128 %systemdrive%\install\myinf.inf

Posted

Thanks. I think it's time to continue studying how INF files work. I started studying this months ago, but I stopped because I got bored, and I thought I'm not going to use it. :lol:

Posted
Thanks.  I think it's time to continue studying how INF files work.  I started studying this months ago, but I stopped because I got bored, and I thought I'm not going to use it.  :lol:

You should. Inf files are the coolest and the easiest way to install apps. I do my entire unattended installation with INF files and all my new changes to my unattended DVD takes less than a few minutes.

Granted it took me some time to get the hang of it, but once I did there is no way I am going back to the .cmd extensions anymore.

Posted
Rundll32.exe setupapi,InstallHinfSection DefaultInstall 128

What does that 128 means? Because under my HKCR\inffile\shell\install\command, I have rundll32.exe setupapi,InstallHinfSection DefaultInstall 132.

Thanks.

Posted

Hey if you haven't already seen this guide, then take a look now atleast. ;)

http://gosh.msfnhosting.com/

He has a trememdous lot of info regarding INF.

BTW, I won't dis-courage you from learning how INF files would work, but I'd say its not worth spending that much time over. Personally, I prefer using XML configure files for uA (check out XPlode) - its easier and good-looking, and functionality is unmatched.

Posted

Thanks for the link prathapml. Infos there are worth reading.

Yeah. XPlode is xml based. And it is really complicated. My stupid brain can't comprehend that for now. :lol: But I'm planning to study that one of these days because I might need it for making installshield projects. There are lots of things that I wanna learn. I'm just taking one step at a time. :lol:

Thanks Yzöwl for the explanation of 128 and 132.

Posted

Edit: oops, this topic has a second page :blushing: Oh well, here's what I posted anyway:

InstallHinfSection

Value   Description 
-------------------
0       System provided INF.
128     Set the default path of the installation to the location of the INF. This is the typical setting.
+0      Never reboot the computer.
+1      Reboot the computer in all cases.
+2      Always ask the users if they want to reboot.
+3      Reboot the computer if necessary without asking user for permission.
+4      If a reboot of the computer is necessary, ask the user for permission before rebooting.

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