/build/static/layout/Breadcrumb_cap_w.png

Copy File from MSI database

I'm trying to include a vbs custom action to copy a file from the MSI file table to the file system before the InstallFiles action.

I have script that can read properties, and open the database ok, but I can't seem to work out how to do the following:
-open database
-select one file
-copy to c:\program files\
inside my vbs.

thanks in anticipation.

update..
turns out that I need to copy it from _streams, have got script that can copy it from source, but as the whole point is I need to drop a file down and run it before the installfiles action, then this doens't work. (wisesource being not accessible at install time)

any help appreciated, thanks

0 Comments   [ + ] Show comments

Answers (8)

Posted by: babric 19 years ago
Senior Purple Belt
0
I found that : http://www.installsite.org/pages/en/msi/ca.htm (Streaming a File From the Binary Table)

Maybe this could help you... I don't know how it works.
Posted by: AngelD 19 years ago
Red Belt
0
Is the file something you want to execute before files are installed to the computer, can't seem to understand why else this scenario would be a good idea so please enlighten me ;)
Posted by: DuncanPaul 19 years ago
Orange Belt
0
Thanks Babic, checked that stuff out, there seems to be quite a bit of useful installshield script stuff out there, but unfortunately I'm using WPS and don't think theres a way to import these things into wise.

Angeld-
thats right, I want to execute a file that doesn't exist on our pc's, before the files get copied down in the normal way by the msi. Background to the issue: we have apps installed with WiseScript, that have no install.log, so when we want to upgrade them with MSI packages, we need to put both the install.log for the old app, and unwise.exe down onto the file system, uninstall the old package, and then carry on and install the msi. (at which time these files that we need get copied to the file system..)

hence my chicken/egg issue with the binary table.
any help appreciated, am about to go to plan b, which is a bit clunky..
thanks
Posted by: AngelD 19 years ago
Red Belt
0
If you read about the "Binary Table" you can store temporary files here that you don't want to get installed but use them for ex. custom actions.
Posted by: DuncanPaul 19 years ago
Orange Belt
0
yes I've seen some info about it, but can't work out how to write files from there back to file system, I can execute them from there with a CA, but I need 2 files, as some of our apps don't have the install.log to uninstall from.

have just thought of a potential resolution, compile install.log into self extracting exe, include in the binary table, run that as a ca, and then after that run the unwise from binary ca, with path to install.log as parameter.

rubbish. we've now decided to resolve this issue outside msi anyhow, thanks for the suggestions, if anyone does read this and knows a better way to stream files from binary table I'd be interested to hear how. thanks,
Posted by: TomB 19 years ago
Orange Belt
0
DuncanPaul,

You should be able to use a CA that runs an EXE stroed in the Binary Table (Type 2).
You can but the UNWISE.EXE in the binary table.

Then you still have the option of calling parameters in the Target column with that and the path to the uninstall.log should be and option, so you should be able to put "[SourceDir]uninstall.log" as a parameter. You just need to make sure your CA comes after ResolveSource, which should be after CostInitulize.

Then you can store the uninstall.log file next to the MSI.

If you do not agree with putting the uninstall.log file next to the MSI you can alway write another CA to run before the CA to run the EXE, such as one in vbscript that writes the uninstall.log file using the files system object to the local machine, then use that as the parameter to the Custom action calling the EXE. However, that seems to be more work.
Posted by: WiseUser 19 years ago
Fourth Degree Brown Belt
0
This single line of VBScript will export all files from your binary table to "C:\Windows\Temp\Exported\":

Database.Export "Binary", "C:\Windows\Temp", "Exported.txt"

Try placing it near the top of your "Execute Immediate" sequence.

All the exported files will have a ".ibd" file extension, but it's easy to rename them.
Posted by: DuncanPaul 19 years ago
Orange Belt
0
Thanks WiseUser, thats exactly what we're after. brilliant. will give it a whirl now.

thanks also Tomb, had previously gone down the path of writing the log out first, but you're right, it was way too much work. storing next to source is also a good idea, which I hadn't had.
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