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
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)
Please log in to answer
Posted by:
babric
19 years ago
Posted by:
AngelD
19 years ago
Posted by:
DuncanPaul
19 years ago
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
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
Posted by:
DuncanPaul
19 years ago
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,
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
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.
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
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.
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
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.