/build/static/layout/Breadcrumb_cap_w.png

How to generate hash for file

I want to add a non versioned file to an msi using a transform with Inst Ed. I know about the method using WiFilVer.vbs but searching this forum I found another script I just don't know how you are supposed to use it. I do not know VBS.


Dim FilePath : FilePath = WScript.Arguments(0)

Dim Installer : Set Installer = CreateObject("WindowsInstaller.Installer")
Dim Record : Set Record = Installer.FileHash(FilePath, 0)
Dim FileHash : FileHash = Record.StringData(1) & vbTab & Record.StringData(2) & vbTab & Record.StringData(3) & vbTab & Record.StringData(4)

WScript.Echo "FileHash: " & FileHash


0 Comments   [ + ] Show comments

Answers (4)

Posted by: nheim 13 years ago
10th Degree Black Belt
0
Hi Joe,
paste it in a text file with the extension .vbs.
Then remove this leftover from HTML cut and paste:
Save it.
Use it on a command line like this: yourname.vbs filetohash.xxx
That returns the hash in 4 parts.
Put the hash in a new line in the MsiFileHash table.
That's all.
Good luck.
Regards, Nick
Posted by: mayur_mak 13 years ago
Senior Purple Belt
0
Hello joe,

u can try using the msifiler.exe contained in windows SDK
Posted by: AngelD 13 years ago
Red Belt
0
As you're already using InstEd:
Right-click the File table entry you want to add an MsiFileHash table entry to and select "Retrieve file details from external source path", make sure to have the source as external prior of doing this.
Posted by: joedown 13 years ago
Third Degree Brown Belt
0
Thanks Nick, it works great. I had created the .vbs file but didn't know what to do next.

I'll have to try the method in Inst Ed next time. That sounds faster.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ