Hi Gaurav,
1.) How to eliminate windows installed drive. I want to automatically drive selection go to last drive
Like F: (hard drive)
Unfortunately we don't have predefined support for this.
However, you can implement this scenario through a custom action. For example, you can take advantage of the
DriveInfo Class which provides access to information on a drive. Once you have the partitions, you can set the
APPDIR property with the desired value (e.g. latest partition). You can set
APPDIR directly from your custom action.
Please take a look on the
Options to integrate and debug custom actions article and on the
Detect whether a path points to an NTFS partition or not thread which may be useful to you.
2.) Assume apps has installed in D: drive and OS windows in C:
And some long days it got formatted drive C:\
Then New OS (Windows) installed.
After that how to Run setup that Auto-find appropriate folder
Then write his path to registry and don't overwrite on existing files.
Files are Database, XLS, User Defined Settings.
That is only install prerequisites and window service.
First of all, you should organize your application into separate folders (e.g. Binaries and UserData). The UserData folder will never be overwritten, instead the Binaries will always be installed (e.g. window service). Add the UserData and Binaries into separate features.
In order to check if your application is installed on a fresh OS, you can create a custom action that will search for a file that must be on the target machine. You need to search for a specific file in order to find the previous installation path of the application. For example, you can take advantage of the
Directory.GetFiles Method. Of course, you can use any other approach that is suitable for your scenario.
Based on the search result (e.g. the application have been installed before) you can
set a property (
e.g. PREVIOUS_INSTALLATION = "true") and use it further to prevent the UserData feature from being installed once again. For this, you can set the
Feature Properties something like:

- UserDataFeatInstallBeh.png (12.63 KiB) Viewed 3573 times
Most likely, you should delete the existing
binaries folder from the target machine before coping the new files.
3.) Apps is "Ngen" compiled on (32bit). When OS is reinstalled as 64bit.
Then Finds his path overwrite DLL AND EXE with NGEN 64bit based.
Following the approach from the previous question will cover this scenario too.
Please let me know if that helped.
Best regards,
Dan
FOLLOW US
Get the latest news in Application Packaging