Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Copying file to SourceDir at runtime


2 replies to this topic

James_dean

James_dean
  • Members
  • 9 posts

Posted 15 July 2005 - 13:01

I want to know what msi functions(if any) could enable me to copy a file to the source directory to enable it to overwrite the one in the source directory with another file. I know there is a function called msiGetProperty and i think i can get the source directory using that but it seems difficult.....
What i want to do is to copy an updated readme file into the project automatically. So my custom action will copy the updated readme file and overwrite the one in the source directory. Can i do this using my dll or any other way?.

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 15 July 2005 - 14:37

Sorry for asking, but can't this be done with a batch file prior to running the setup?

I suppose you could use the [SourceDir] property as you suggest, and then use a script to copy the file to this directory (though I have never tried it). You would probably need an immediate mode custom action run after the ResolveSource action.

The code would be something like this:
CODE

Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
SourcPath = "D:\WhateverPath\File.txt"
DestionationPath = Session.Property("Sourcedir")
fso.CopyFile (SourcPath, DestionationPath)


I didn't check the code above, more info here:
http://msdn.microsof...mthcopyfile.asp
Regards
-Stein Åsmul

James_dean

James_dean
  • Members
  • 9 posts

Posted 19 July 2005 - 12:14

A batch file would even do........can you overwrite the source directory inside the setup exe with a batch file. If so...how?