|
#1
|
|||
|
|||
|
file.copy issues
Is it possible to use relative file paths? I can't find anything on this subject, but it appears that a full path is always needed.
I need to copy a file from an Install directory up one directory (to the App dir.). The problem is that my patch is in the Install dir. I can reference the source file with: _SourceFolder .. "\\test.txt" but how do I reference the destination dir? The source dir is: C:\Program Files\WCP\Install and the destination dir is: C:\Program Files\WCP The only solution I can think of (without being able to use relative paths) is to have the patch in C:\Program Files\WCP. Then I should be able to reference the Install dir with something like: _SourceFolder .. "\\Install\\test.txt" Any suggestions? Thanks for any help, Chuck |
|
#2
|
||||
|
||||
|
Quote:
Code:
SessionVar.Expand("%AppFolder%")
__________________
--[[ Indigo Rose Software Developer ]] Last edited by Lorne; 01-03-2007 at 03:21 PM. Reason: Edited to say what I meant, and not what I said. :) |
|
#3
|
|||
|
|||
|
Isn't the AppFolder the one that I am running the patch from? In my case, the app folder is one folder higher. I am patching a file one folder below the app folder.
|
|
#4
|
||||
|
||||
|
_SourceFolder is where your patch is running from.
%AppFolder% is the root folder where your software is installed -- the location of the software to be patched. %AppFolder% is typically determined by your patch, normally in the On Startup script. In order for your patch to work it needs to find and identify the software to be patched...so by definition %AppFolder% should already be pointing to this: C:\Program Files\WCP So your destination folder would just be SessionVar.Expand("%AppFolder%").
__________________
--[[ Indigo Rose Software Developer ]] |
|
#5
|
|||
|
|||
|
Thanks, I'll try that, although I don't know how the software is going to know that my app is installed in a higher directory. The file being patched is in a sub-dir and NO files in the "app" dir are referenced in the patch. This is because I need an unopened version of the Access database to patch, and I keep that file in my Install directory. After the patch, I copy the patched file up one dir and rename. Perhaps I need to set up VP differently. I guess that all this discussion means that relative paths are not supported.
Last edited by CPR; 01-03-2007 at 07:51 PM. |
|
#6
|
||||
|
||||
|
Quote:
Does your installer/application store any paths in the registry, or in the user profile? If so, you could read the location from there, and use that for the file copy. You could also just parse the path (either _SourceFolder or %AppFolder%) using string functions to get the path to their parent folder. In fact, here's a little function to do just that: Code:
function GetParentFolder(FolderPath) local strPath = String.TrimRight(FolderPath, "\\"); local nLastSlashPos = String.ReverseFind(strPath, "\\", true); return String.Left(strPath, nLastSlashPos-1); end Quote:
__________________
--[[ Indigo Rose Software Developer ]] |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| File.Copy recursive error handling | Buffman | AutoPlay Media Studio 6.0 | 0 | 12-06-2006 01:56 PM |
| dialog.message and file.copy help | dms | AutoPlay Media Studio 6.0 | 2 | 08-09-2006 07:49 AM |
| File.Copy does not work as advertised | tkilshaw | Setup Factory 7.0 Discussion | 2 | 05-18-2005 12:51 AM |
| Copyright Issues for "How To..." Training? | sferguson | General Chat | 3 | 11-03-2004 04:51 PM |
| Media Player 9.0 Issues in AMS40 | Brett | AutoPlay Media Studio 4.0 | 0 | 01-23-2003 11:26 AM |
All times are GMT -6. The time now is 06:14 PM.







Linear Mode

