Archive: Reinstall section doubt


Reinstall section doubt
Hi all,
I am a newbie. I am developing an installer and i have a doubt.
When someone tries to reinstall my installer, in my installer script how can i know that my installer is already being installed and someone is trying to reinstall it again ? Is there any facilities already available in NSIS or i have to do it myself by checking registery entry that i made, etc?
Sorry if this topic is already discuss in forum, i searched but i only got what to do while reinstalling.


You may use InstallDirRegKey for this...

http://nsis.sourceforge.net/Docs/Chapter4.html#4.8.1.22


The problem is that, i am not making a registry key entry while installation because i don't want to touch registry.
So is there anyway that i can find out that my product is already installed without reading the registry ?


All good windows applications are SUPPOSED to be registered under the windows add/remove programs section of the registry. But, if you're not using that, then I guess you'll either have to use your own data file (usually the local app data folder--$LOCALAPPDATA within NSIS) or look for something specific to your program (like maybe a file that your application installs.)

My suggestion (if you aren't going to use the Windows add/remove programs control panel) would be to write an INI file of some type to somewhere under $LOCALAPPDATA during the initial installation. Include the version of the application too. This will allow a quick version check for future upgrade installs. (And don't forget to delete this file when you uninstall the app.)


Thanks for the info. Either i have to make a registry entry or i have to store the information myself. I was thinking maybe there is some functionality in NSIS which tells that the particular installer is already installed or not.


That is completely down to you. There is no install database like Windows Installer. You can store information in the registry or in INI files or just check if some files exist to determine if something is already installed.

Stu


Can i directly call Uninstall section from .onInit Function? How do i do that? Actually i am checking if the product is already installed in .onInit Function and want to call Uninstall section if its already install. I tried with copying uninstall section code to .onInit Function and run it if the product is already install, in this case it uninstalls the product but it does not shows any screen(like screen with progress bar. please help...


http://nsis.sourceforge.net/Auto-uni...installing_new