Jump to content
damian666

[Solved] Weird problem with filesize check...

Recommended Posts

damian666

Hi guys,

 

i have a script to change some icons in windows 10, because current icons are fugly :P

Func SizeCheck()
    FileCopy(@WindowsDir & "\system32\imageres.dll", @ScriptDir & "\check-imageres.dll", 1)
    sleep(2500)
    
    local $size1 = Round(FileGetSize(@ScriptDir & "\check-imageres.dll") / 1048576, 1)
    local $size2 = Number(IniRead(@ScriptDir & "\FileSize.ini", "Sizes", "ImageRes.dll", "0"))

    TrayTip("Icon Changer", "Current size is " & $size1, 0, $TIP_ICONASTERISK)
    sleep(2500)
    TrayTip("Icon Changer", "Patched file size is " & $size2, 0, $TIP_ICONASTERISK)
    sleep(2500)

    ;FileDelete(@ScriptDir & "\check-imageres.dll")

    if $size1 = $size2 Then
        Return True
    Else
        Return False
    EndIf
EndFunc

my problem is that the file reports 57.3mb in the destination, but when i copy it to the workdir, its 54.4mb

 

anyone knows what the hell is up with that?

 

Damian

Edited by damian666

and proud of it!!!

Share this post


Link to post
Share on other sites
damian666

here ya go

sshot-1.png

sshot-2.png


and proud of it!!!

Share this post


Link to post
Share on other sites
Jos

Do you have a x64 OS?

Your script likely runs in x86 mode so you need to check the C:\Windows\SysWOW64 directory version.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
damian666

hmm... that one is indeed 54.4, BUT... i explicitly use @WindowsDir & "\system32\"

 

to get the right one, that should be the right one not?


and proud of it!!!

Share this post


Link to post
Share on other sites
UEZ

On my WIn 8.1 x64 both imageres.dll versions are the same size (48.847.872 bytes) and your function seems to work properly.

I will test on my Win10 vm and will reply if I get the same result.


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
damian666

cool UEZ, just remember, that my imageres is patched with icons from 7/8, hence its size difference.

Edited by damian666

and proud of it!!!

Share this post


Link to post
Share on other sites
Jos

hmm... that one is indeed 54.4, BUT... i explicitly use @WindowsDir & "\system32\"

 

to get the right one, that should be the right one not?

​Well, it all depends how you Run/Compile your script either using the x86 or x64 versions.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
damian666

i compile it x86, always do :P

 

but even when ran from scite it does the same...


and proud of it!!!

Share this post


Link to post
Share on other sites
Jos

i compile it x86, always do :P

 

but even when ran from scite it does the same...

​Yea, that probably runs AutoIt3.exe, which is the x86 version.

Just play with this statement when you have the full SciTE4AutoIt3 installer:

#AutoIt3Wrapper_UseX64=y ; and try also n

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
UEZ

No problem on my WIn10 x86. File sizes are the same on both locations.

 

The strange thing is on your 2nd screenshot -> file size and size on disk are the same values!

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
damian666

what the hell... xd

 

that did it Jos, using X64 compile made it report the right size.

then my next question is... how the hell will i make it choose the right file if that doesnt work?

 

using x86 compile should default to system32 right? and x64 compile should look in syswow...

 

but now its backwards? O.o

 

Edited by damian666

and proud of it!!!

Share this post


Link to post
Share on other sites
Jos

You could say the following:

The C:\Windows\SysWOW64 directory is the C:\Windows\System32 directory for X86 programs.

Jos

 


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
damian666

i really dont understand that... LOL


and proud of it!!!

Share this post


Link to post
Share on other sites
UEZ
  • Like 1

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
iamtheky

DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)

that one line fixes most of my redirection issues

  • Like 1

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites
damian666

Thanx for the read UEZ, that makes it clearer for me :)

 

boththose, that single line fixed it all, thak you very much :)

 

Solved.


and proud of it!!!

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

×