Copying files multiple times to different destination folders - file

I want to deploy a plugin for Autodesk 3ds Max with an Inno-Setup. If the end user has 3ds Max installed multiple times (in different folders) for having different languages (3ds Max isnt multilingual) I want the setup to copy the plugin-files to the several 3ds Max folders, but without copying the [Files] Source: "plugin.dll" DestDir: "..." . Can it be done programmatically with the pascal scripting, that the files are copied again but always with changing destination folders?

Why don't you want multiple [Files] entries? They will only be included in the setup once.
If you want to copy them in [Code], you can use the FileCopy() function in either the AfterInstall handler function for the file, or the CurStepChanged(ssPostInstall) event function.
Note that if you install them manually, you lose all automatic reference counting, registration, and uninstall handling, all of which you'll need to replicate in code.

Related

Update file across multiple folder locations?

I need something that can copy a specified file any and everywhere on my drive (or computer) where that file already exists; i.e. update a file. I tried to search this site, in case I'm not the first, and found this:
CMD command line: copy file to multiple locations at the same time
But not quite the same.
Example:
Say I have a file called CurrentList.txt, and I have copies of it all over my hard drive.  But then I change it and I want all the copies to update.  So I want to copy the newer one over all the others.  It could 'copy if newer', but generally I know it's newer, so it could also just find every instance and copy over it.
I was originally going to use some kind of .bat file that would have to iterate over every folder seeking the file in question, but my batch file programming is limited/rusty.  Then I looked to see if xcopy could do it, but I don't think so...
For how I will use it most, I generally know where those files are going to be, so it actually might be as good or better if I could specify it to (using example), "copy CurrentList.txt, overwriting all other copies wherever found in the C:\Lists folder and all subfolders".
I would really like to be able to have it in a context menu, so I could (from a file explorer) right click on a file or selected files and choose the option to distribute it.
Thanks in advance for any ideas.
Use the "replace" command...
replace CurrentList.txt C:\Lists /s

Copying multiple files to a Winscp directory via Script

I have a problem when trying to upload multiple files to one WinSCP directory, i can manage to copy just one single file, but the problem is that i need to upload many files that are generated by a software, the names are not fixed ones, so i need to make use of wildcards in roder to copy all of them, i have tried many variants on the code, but it all was unsuccessful, the code i am using is:
open "sftp://myserver:MyPass#sfts.us.myserver.com" -hostkey="hostkey"
put "C:\from*.*" "/Myserverfolder/Subfolder/"
exit
This code does actually copy the first alphabetically named file, but it ignores the rest of the files.
Any help with it would be much appreciated
Try this in script
Lcd C:\from
Cd Myserverfolder/Subfolder
Put *
Try and do all manually first so you can see what's going on.

exec ant replace a value in a .m file

how to write an exec task in ant to replace two values in .m file.
Because I want to replace the version number in iphone app, including my build number which i build using hudson, i remotely access the macos and get the app to be copied on to my windows
system, so i generated the build using ant exec tasks, but now i want to replace my build number into the concern file before compiling,
so how can i use exec task to replace certain values in a file.
I know propertyfile task which replaces the value in a property file, but it doesn't work for
this.
If you have a template file, you can use the <copy> task with a nested <filterset> to replace certain values. If not, you can still use <copy>, this time with a nested filter chain containing a <replaceregex> token filter. If you want to edit in place, you can move the newly created file to the old location afterwards.
The use of <exec> is almost certainly a bad idea for your application, as it would make your build rely on external applications which usually are not available on all platforms, thus breaking portability of your build.

Batch File task in windows - Find and replace across multiple files

I have to write a batch file which finds and replaces values of version and build with their new values given by the user as an input.
The user initially gives 3 values: Apps, version and build values (the new values).
The search is then made across multiple .property files in a folder. The Apps value is searched across multiple files and wherever there is a match, the version and build of that file will be replaced by the values given by the user.
To Find and replace across multiple files easily, use FART!

copy folders using nsis installer, display only one status window for copying multiple folders , copy multiple folders together

CopyFiles of NSIS installer displays different "Windows Status windows of the copy operation" when copying different folders, but i want that only one status window is shown ,whether i copy one or two or five folders, like in Windows, when we select two folders , then only a single COPY STATUS Window is shown in which the progress of copy operation for both the folders is displayed.
Is this possible? I want to copy multiple folders, but show only one status window of the copy operation.
You can't do it with CopyFiles which only allows a single "from" path. Here are three alternatives:
You could do the first, check the error flag to see if the user cancelled it and if it's not set use /SILENT on the second.
You could use /SILENT on both (personally I never use CopyFiles without /SILENT as I don't want the user to be able to cancel it).
If you really want to, you could do it with a direct DLL call - I don't know what the function would be and I expect you would need to construct a null-separated double-null-terminated string, all of which is fiddly with NSIS. I doubt that you'll think it's worth it. If you really want to do it this way, for a null-separated string use NullByte.nsh which we at PortableApps.com wrote for the PortableApps.com Launcher (for dealing with kernel32::GetPrivateProfileSection - we've since switched to parsing the INI file in pure NSIS as it's faster and not buggy; we will also use for dealing with services).

Resources