automatically backup files to target folder in windows 10 - windows

Say I have certain file d:\homework\week1.pdf which requires constant backup to another folder e:\backup. How can I get windows10 to automatically copy and overwrite the file week1.pdf from source folder to target folder when I make change to it? I don't want other files except week1.pdf in source folder copied.

Related

Hosted macOS Preview deploy ipa to App Center

I have set up a hosted mac os preview build for a Xamarin app. All the steps complete except for 'deploy ipa' The publish artifact says nothing will be added. Here is are the settings from the copy files to as well as the output
Seems you set the incorrect Source Folder or Contents pattern in Copy Files step. That caused no files were copied to target folder for publishing.
Please check the logs of Copy Files step to see if the *.ipa files are really copied to $(build.artifactstagingdirectory).
If no files copied, then just check the build logs to get the real working directory (Source Folder in copy step) and make sure the *.ipa files are generated in the directory. (By default it's $(system.defaultworkingdirectory) on my side.)
If the real working directory is just the Source Folder $(Build.SourcesDirectory) you specified in Copy step, then the problem should be the contents pattern.
Contents specify minimatch pattern filters (one on each line) that you
want to apply to the list of files to be copied. For example:
** copies all files in the root folder.
**\ * copies all files in the root folder and all files in all sub-folders.
**\ bin copies files in any sub-folder named bin.

Copy app.publish folder in VSTS Build/Release

Similar to the question here: Copy one file in target directory on deploy from visual studio team services, I am trying to copy the contents of the app.publish directory of a ClickOnce application via VSTS build/release.
This is the Copy Publish Artifact step of the Build
This obviously outputs everything in the bin folder to the drop folder on the server share.
This is the Copy Files step of the Release
This copies only the files in the app.publish folder but it builds out the entire hierarchy to the folder app.publish folder; however, it builds out the full folder structure. i.e. bin\Release\app.publish or bin\Debug\app.publish.
I like the idea of being able to publish and store different configurations (debug/release) but I don't like that I'm having to specify the InstallUrl in the msbuild arguments in order to pick up debug/release in the folder path. Even if I didn't try to maintain multiple configurations, the configuration would still be in the path.
So my question is: Is there a way to use the copy files task to just copy the app.publish folder and/or the contents to another location, without it creating the full hierarchy?
You need to specify the copy root in Source Folder of Copy Files, in your example, the copy root should be like:
Source Folder: $(System.DefaultWorkingDirectory)\$(Build.DefinitionName)\bin\$(BuildConfiguration)\
Contents: **\app.publish\**
In this way, you should only have app.publish in your Target Folder.
Configure the "Copy Root" of "Copy Publish Artifacts" step in your build definition to the path of build configuration folder and "Content" to "**".
For example, if the path of your build output is:
C:\a\1\s\SolutionFolder\ProjectFolder\bin\Relase\app.publish...
You can set the Copy Root to:
$(build.sourcesdirectory)\SolutionFolder\ProjectFolder\bin\$(BuildConfiguration)
And Content set to:
**

Working directory vs output path in visual studio

What is the difference of the working directory vs the output path in visual studio?
Is it bad to set both setting to the same directory like '....\bin\'
By default they are the same. Assuming you're debugging some application it will be bin\debug.
Output Directory is where your output files goes. By default, Visual Studio builds each project in a solution in its own folder inside the solution. You can change the build output paths of your projects to force all outputs to be placed in the same folder
Working Directory is the location which Specifies the working directory of the program being debugged. It is the default place in which a program is looking up it's files. Normally the working directory is the directory the application is launched from \bin\debug by default.
So every opened file will be opened relative to the working folder.Let's say if you have an application installed in c:\myapp with all lib files in the same directory then you will set your working directory to myapp folder and you can do so from project properties.
By default, working directory is the output directory. Both can be changed, you can set another directory or common directory for all projects for output directory that determines a relative path for the output file that might be an executable or a static library.
Working directory also provides a relative path to put files that are used by the program. You can put a log file into a place that you can use its directory as a relative path in the code instead of absolute path. If your working directory is myproject\src and your log file is in myproject\src\log\log.txt then you can open or write the log file with log\log.txt in the code rather than c:\blabla\myproject\src\log\log.txt.

copy file from executing folder and paste into installing folder in installshield( InstallScript project)

I am creating a InstallScript project in installshield 2011 and my problem is
I want to know the path of the setup from where it is executing
Suppose there is a folder name "project_setup" in which setup.exe and abc.txt file exist.Now at run time I want to copy abc.txt file and paste it to where the setup is installed.
EDIT:
Now I am able to copy the file but In my Release folder there are 2 setups
In Disk Image/Disk1 folder (This setup Copy&Paste the .txt file and execute fine)
other is in the Package folder (This setup dont Copy&Paste but execute fine)
So how to make setup in Single exe so that it execute as well as copy&paste .txt file also.
CopyFile(SRCDIR ^ "abc.txt", TARGETDIR ^ "abc.txt");

Xcode - Dealing with folders by code

When you add a folder that contain subfolders and files to the Xcode project, the Xcode ask you about the folder option:
Create groups for any added folders.
Create folder references for any added folders.
I want to download the folder from a server. When the download is complete, the folder option will be 1 or 2? How can I set the folder option to option 2?
When Xcode references a folder, it uses whatever files are stored at that location on your local disk. If you download a new file to that folder or copy a file into that folder, it will show up in your Xcode project. If you change a file in that folder (by overwriting it in the Finder, or by using another app to download another copy of the file over the existing one), Xcode will use the new one.

Resources