how do I skip files and the directories that contain them with the skip directive in msdeploy? - msdeploy

We are deploying a website to a DFS share. DFS creates shortcut files with the name .DFSFolderLink.lnk in various locations. Admins on the box do not have rights to delete this shortcut file. So if any exist I need to exclude them from deployment, so that they will not be deleted.
I can already exclude the .DFSFolderLink by passing -skip:File=.DFSFolderLink.lnk to msdeploy. However, if the directory that contains the shortcut file does not exist in the package being deployed, then an error is raised because it tries to delete the folder but cannot because the shortcut file still exists.
How can I get it to exclude the shortcut file and the directory that contains it without knowing ahead of time what the directory name is?

If you don't know the name of the directory, you can't skip it. What you can do is tell msdeploy to ignore the "directory not empty" error using the ignoreErrors provider setting:
msdeploy -verb:sync -source:... ^
-dest:auto,ignoreErrors=80070091,computerName=... ^
-skip:File=\.DFSFolderLink.lnk

Related

What is the reason that kernel need execution permission to traverse in directories?

In *nix it is being said that, everything is considered as file (even it is a directory). Then, If directory is a file which does not contain any binary or any executable data, but only contain inode number and file name, then what is the need of "execute" permission for directory file ???
Here i attached screen-shot, that showing directory has execute permission
also i have seen(on another site) directory's Execute permission means:
"Execute bit = You can make this directory your working directory".
but just making "directory as our working directory" is it the only one reason to provide "Execute" permission for directory ??
please can any one provide the exact reason for "execute" permission.

Unable to remove a folder containing file

I'm using Robotframework 3.0 in java platform using RIDE on windows 10. I'm trying to use commands from the Operating system library like "Empty Directory and Remove Directory". After executing those commands I get this error: "OSError: unlink(): an unknown error occurred: Directorypath" and Directory does not exist
Here is the list with all the combinations I used and the output I received
My questions are:
1. Using Remove Directory recursive=True; Why this command is not able to delete the folder if it has a file. I was able to use the same command without any errors.
2. Using Empty directory, Why I'm getting error that the directory does not exist. I understand that the directory is not available. I was assuming that this command will ignore if the directory is not available. If my assumption is wrong then how can I solve it.
I would need help on the fail scenarios.
Empty Directory does in fact check does the target directory exist (that happens in a private keyword _list_dir in the library).
If you want to call it, and not fail the case if the dir does not exist, then surround it in Run Keyword And Ignore Error:
${rc} ${msg} Run Keyword And Ignore Error Empty Directory ${target dir}
Run Keyword If '${rc}' == 'FAIL' Handle Failed Deletion As You Like
As for 1), when you do call Remove Directory with recursive=True, it will/should have no problems deleting the directory and any files/subdirectories from it.
The error you're seeing - OSError: unlink() ... is propagated by the python's shutil module, which does the actual deletion. There could be a number of reasons - the account you're running the tests with does not have permissions to delete that specific file (most likely), the file was added in parallel with the delete operation (not that likely, the exception would then be that the holding dir could not be unlinked), or similar reasons. Try it with a different path, not the windows user's temp dir, but one on which content you're sure you have full access and control.

Publishing project with files with very long names

I am trying to publish a project in Visual Studio 2013 that has some files with very long names, including the path location. I moved the project to a location closer to my root C:\ drive, which allows it to compile, but when publishing, it tries to copy files to the %appdata% folder which results in a name over the limit.
Here is the error I get:
Error 10 Copying file node_modules\grunt-bower\node_modules\bower\node_modules\bower-registry-client\node_modules\bower-config\node_modules\optimist\node_modules\minimist\.travis.yml to C:\Users\jake\AppData\Local\Temp\WebSitePublish\WebProject--1320288221\obj\Debug\Package\PackageTmp\node_modules\grunt-bower\node_modules\bower\node_modules\bower-registry-client\node_modules\bower-config\node_modules\optimist\node_modules\minimist\.travis.yml failed. The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. 0 0 WebProject
Is there a way to either adjust this project's name or where it copies to temporarily so that I am able to publish from Visual Studio?
Citing #Britton from Temp path too long when publishing a web site project:
Add this to your publish profile to modify the temporary directory for
package/publish:
<AspnetCompileMergeIntermediateOutputPath>c:\shortPath\</AspnetCompileMergeIntermediateOutputPath>
Or according to Website publish failing due to file path being too long (citing #Jason Beck and #VeeKayBee):
Add the following line in default PropertyGroup of web project file:
<IntermediateOutputPath>..\Temp</IntermediateOutputPath>
In addition to Amnon Shochot's answer, above, I also had to apply Roland's answer from another thread.
My publish paths (in .pubxml) now look like this:
<publishUrl>c:\publish\proj\</publishUrl>
<IntermediateOutputPath>c:\publish\inter\</IntermediateOutputPath>
<_PackageTempDir>c:\publish\package</_PackageTempDir>
You have to be careful with this:
Important: If this option is set, be sure not to nest your temporary files inside the publishUrl directory, because it will wipe out the _PackageTempDir files, causing a failed publish, even if it appears successful.

Change the default directory for Brackets

I have tons of files in my home directory (~), and each time I open Brackets, it tries to load and index all the files there. Eventually, after freezing for a minute, it throws the error:
Error Indexing Files: The maximum number of files have been indexed.
I can of course switch directories after this freeze, but how do I set the default directory for Brackets to be another directory (not the home directory), thus avoiding this freeze each time Brackets is initiated?
Brackets should be remembering whichever project you had open last. Your state settings file may be corrupt. Try these steps:
Quit Brackets
Navigate to the following folder:
Mac: ~/Library/Application Support/Brackets
Linux: ~/.config/brackets
Find the state.json file and change the projectPath parameter to a new default path
If state.json cannot be found, make sure this folder has write permissions for your user account
If the above did not work, try opening the state.json to see if it's corrupted (possibly by a buggy extension). If all fails delete the file altogether and restart.

How to copy a license file which is placed with the setup.msi to target directory (setup created with msifactory)

I have created a Setup file i.e. setup.msi , this file contains a website installer
I have a License.xml file that I want to give to my client with the installer (setup.msi).
Before running the setup.msi , client has to make sure that the License.xml file should be in the same directory where setup.msi resist.
I want my setup.msi file to copy the License.xml file to the Destination directory (where website will be installed , this path will be prompted to user for customization)
I am using MSIFactory for creating setup.msi. I am not able to do this. I searched over net but did not get any accurate answer.
I am not familiar with MSIfactory, but in installshield what I would do is, call a batch script to do the copy and pass the target directory as a parameter to it. or use the 'XCopyFile' function to do the copying.

Resources