We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

india.26715
Posts: 11
Joined: Fri Dec 26, 2014 10:42 pm

Auto eliminate Windows installed Drive during installation

Hey,
I have three questions.
1.) How to eliminate windows installed drive.
Like mostly windows is installed in c drive.
I want to automatically drive selection go to last drive
Like F: (hard drive)

OR Last (hard drive - 1) = E:
I am working with access database and whenever
Windows drive need re-formatted there may be chance
To loss the Data.

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.

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.


Regards,
Gaurav
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Auto eliminate Windows installed Drive during installati

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
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
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
india.26715
Posts: 11
Joined: Fri Dec 26, 2014 10:42 pm

Re: Auto eliminate Windows installed Drive during installati

Thanks Dan for your support.

These works as expected.
Regards,
Gaurav
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Auto eliminate Windows installed Drive during installati

You're welcome Gaurav,

If there is anything else I can help you with, please let me know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”