Retain files after Uninstallation - installshield-2011

Certains files i am copying from one dir to another dir by using CopyFile command in Installshield 11 Premium. I want to preserve copied files even after uninstallation of product. What are the ways to do so?
-Dev

Use Disable(LOGGING)....Enable(LOGGING). Put your copy function between this.
This way, the copy action will not be captured in the log and will not be deleted.

Related

How to search only in currently open files in vscode?

I usually work on larger projects with many files that would contain the search query. So I would open the files I want to modify and do a find/replace across all currently opened files. Can this be done in vs code?
The feature I'm looking for is implemented in Notepad++, but I'd prefer not to have to switch editors for this task.
For me somehow it works just by typing ./ in the files to exclude field.
The ability to search only in the open editors is in the Stable Build v1.55.
As you can see, the icon is at the end of the files to include input so you will have to have that showing (click the three dots ... just below the search options if files to include is not already showing).
"Search: target particular set of files #20530" located here: https://github.com/Microsoft/vscode/issues/20530
Is tracking a search "scope" such as "all open files".
Hit Ctrl + Shift + F and enable the icon at the end of the 'file to include' text field
I don't think there's a way to do this. You can make a feature request on github. I think an extension could do it though.
There is a checkbox for this in the "files to include" field since version 1.55 (march 2021).
The answer was already mentioned (and accepted above) indeed typing ./ in the files to exclude box of the search window will allow you to only search in open files.
However the response mentioned that he was unsure why this worked. VSCode allows you to exclude all files in a directory by writing the directory in the exclude box. The directory . is the directory where VSCode is opened ie the root directory. The filter ./ excludes all files in the VSCodes root directory so all files are excluded. However opened files ignore any exclude filter. So if you exclude all files only the opened files will be searched.
The best way to find something you are searching for within a specific file in vs code would be:
Ctrl + p then pressing # on the search bar.
It will give you a list of all functions on the file, which makes it easier to track something down.
As an alternative to using Visual Studio Code itself, you can just search the file contents within the folder where unsaved files open in Visual Studio Code are located. This would be in one of these locations depending on which OS you are running:
Linux: /tmp/ (someone else running Linux can verify this)
macOS: ~/Library/Application\ Support/Code/Backups/
Windows: %APPDATA%\Code\User\
This extension is what I use for this purpose.
You may need to change the keybinding if there is a conflict.

How to Get specific version of solution when there are multiple solution?

I have multiple solutions in a folder. For example
C:\Code
-Solution1.sln
-Solution2.sln
-Solution3.sln
-[All other project files/folders belongs to above solution, etc]
Note that having these solutions in separate folders is not an option for me.
Assume if I open a one solution in VS2012 (i.e Solution1.sln). I right click on the solution
and select Source Control -> Get Specific Version...
Select Type "Latest Version", and tick two check boxes
a. Overwrite writable files that are not checked out
b. Overwrite all files even if the local version matches
And then press the "Get" button.
The problem is that this operation gets the all the latest files for the c:\Code folder - even the ones that are not belongs to my current opened solution (Solution1.sln). It replaces the files for Solution2 and Solution3.
Is there a way I can configure TFS only to get Solution1 file?
I'm using TFS2012
Update: Please see the sample structure below.
Okay. You have to move all your solution files to a solution folder will solve your problem. TFS is trying to get all the files from the solution folder and its sub folder. That's why you having this issue. Create a folder called Solution, you can create it inside the code folder or outside. Open your solution1 file in vs2012 and select the solution file and choose File -> Save Solution1.sln as and save it in the solutions directory. Repeat the same for all the solution files.
Once you are happy with the new solution files from the solutions directory, delete the old solutions files form the code directory.
Browse to your solution in Source Control Explorer, select "Get Specific Version" from the Advanced menu: it should work fine.

How to check if file locked/used by other process NSIS

Hi I am writing nsis script for a patch installer. Before installer copies new files I need to check if any process is using the files I want to replace and I want rename those files to tmp and delete them on reboot.
Is there any way installer can detect that if any process is using those files (in my case the files I am going to install are dlls).
There is no native way in NSIS how to do this. But there are third party tools which can detect dlls used by certain process - maybe you could use them in your installer.
But my question is: Do you really need to detect this?
What about deleting files directly with Delete /REBOOTOK file command? (http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.4.11)
If /REBOOTOK is specified and the file cannot be deleted then the file is deleted when the system reboots.

Corflags.exe cf001 Could not open file for wiriting

I am trying to edit the corflags file so that I can run 32bit applications on a 64 bit pc but everytime I try to edit the file using something like corflags.exe assembly /32bit+ it comes up with the error message cf001 could not open file for writing.
Now I have tried a lot of different options such as:
Running in administrator mode;
Finding the file using a search and checking read only is not ticked
Checking that user full control is ticked
Tried to set the whole folder to non read only
When trying the whole folder, it goes through looking like it has set read-only, but then I click OK and re-right click on the whole folder, the box is filled in (not ticked) does this mean that part of the folder is read only and why does it reset to read only?
I just faced the same problem and have tried the same things.
Run cornflags from an elevated ("Run as administrator") Visual Studio Command Prompt. I did the same for a copy of the original .exe just to make sure no other process was using the program.
Create a copy of the file you intend to target with CorFlags.
(e.g. "WcfServiceHost.exe" --creates--> "WcfServiceHost - Copy.exe")
Rename the original file to something else:
(e.g. "WcfServiceHost.exe" --> "WcfServiceHose_Original.exe")
Rename to copy to the original file name
(e.g. "WcfServiceHose - Copy.exe" --> "WcfServiceHost.exe"
For my purposes, I created copies and named them describing their configuration:
Example:
WCFServiceHost_With32BitOn.exe
WCFServiceHost_With32BitOff.exe
Now I can destroy the WCFServiceHost.exe files and create them from these pre-modified copies. No more CorFlags operations necessary.
Note: this is basically a more verbose version of #RMalke answer and that answer should be marked as the answer.
I realise this is years later, but for anyone else looking, I found that the quickest way was to copy cmd and corflags.exe into the same folder as the one you want to edit. Then run cmd as admin from there.

Installshield : How to preserve files after uninstallation

I am using installshield 11 to create Basic MSI Project. My requirment is, when i unstall the project, i want to preserve certain files.( I don't want these Certain files to be removed when unstallation takes place ). Morover, these files are not a part of the component, but they are created(copied) during installation process by using copyfile (script) command from specific location.
-Dev
Use Disable(LOGGING)....Enable(LOGGING). Using CopyFile() in-between these methods will prevent uninstall removing the files
Windows installer removes only those files and folders which it installs. That is each file present in it's database in File table and Folder table. It do not remove any file which does not have entry in File table, similar for folder.
Also, If folder is not empty then that folder does not get deleted during uninstall.
If your installing some files using Copyfile script ( may be using any custom action) then those files will not be removed during uninstall.
Thanks Balachandra for your response, But i have below observation which might help.
Files which i want to preserve is created by CopyFile, and target dir which i mention in the copyfile command does not exist. So CopyFile creates the folder and copy the file to that folder. So obviosly we will not have this folder entry in the dir table of installsheild
But this approach does not help, uninstallation is removing all copied files from this folder.
-Dev
Thanks, Alerter, I've been fighting this one for 2 days.
We install an example configuration file and create a copy of it (on first installation). We needed to preserve the configuration file if the customer changed it, but the file was always getting deleted on uninstall. Disabling the LOGGING around the CopyFile command was exactly the solution for this situation.
Dev, I know this is an old post, but you should accept this as the correct answer.
Hopefully this phrase will help others find this solution easier through the search engines: Installshield file created with CopyFile is always deleted during uninstall

Resources