PDA

View Full Version : Possible to retrieve current installdir from prior install?



NewsArchive
04-28-2014, 01:37 AM
On install does SB7/8 remember in the registry where the %InstallDir% is
located? The reason is that some techs have placed my app folder not in my
approved location and when updates are required the install wants to install
in the folder I designate and not where the tech has located it. If SB8
saves the InstallDir and I can retrieve and insert that as the Install
directory, it would be quite useful. Any ideas?
Thanks
Nev

NewsArchive
04-28-2014, 01:37 AM
Look into the Detect Previous Version function.

Also... I have my installer save the InstallDir path and date into HKLM.
I also have my app save the path where it's running and current date into
HKCU. This is for people who decide to cut-and-paste a folder to a
different location, or install the software by copying from another machine.

When I do an update, I check both of those paths, and the dates.

Jane

NewsArchive
04-28-2014, 01:37 AM
Thanks Jane
I see I can use an ini file to put and get. That should work perfectly.
Nev

NewsArchive
04-28-2014, 01:37 AM
Nev,

> I see I can use an ini file to put and get. That should work perfectly.

I would recommend the registry since odds are the entry won't get
deleted by the user whereas an INI file can easily go bye-bye!<g>

--
Lee White

RPM Report Viewer.: http://www.cwaddons.com/products/rpm/
RPM Review........: http://www.clarionmag.com/cmag/v11/v11n06rpm.html
Report Faxing.....: http://www.cwaddons.com/products/afe/
---Enroll Today---: http://CWaddons.com

Creative Reporting: http://www.CreativeReporting.com

Product Release & Update Notices
http://twitter.com/DeveloperPLUS

Windows 8 brings us "The Oval, Bumper Car, Roller Coaster of Wait!"

NewsArchive
04-28-2014, 01:38 AM
You are probably correct Lee as the Putini in SB8 appears to be correct but
it is not writing to the ini file during the install. Just need to find a
location in the registry to park it.
Thanks
Nev

NewsArchive
04-28-2014, 01:38 AM
Yep! That works. Thanks Jane and Lee.

Neville Wright

NewsArchive
04-28-2014, 01:38 AM
> Just need to find a location in the registry to park it.

Since your installer is running elevated, the suggested standard would be:

HKLM\Software\YourCompanyName\YourProduct

(HKLM being HKey Local Machine)

You can add data at that level such as the install path, installed version,
date, etc.

The good thing is that the user (running non-elevated) can't easily change
this, but your program (running non-elevated) can read it.

We use this methodology and read the settings on startup as part of our
process to determine if the program was installed properly, or just copied
to the machine.

Charles


--
-------------------------------------------------------------------------------------------------------
Charles Edmonds

cjeByteMeSpammers@lansrad.com (remove the "ByteMeSpammers" to email me)
www.clarionproseries.com - ProScan, ProImage, ProPath and other Clarion
developer tools!
www.ezchangelog.com - "Free ChangeLog software to manage your projects!"
www.setupcast.com - "A revolutionary new publishing system for software
developers - enhanced for SetupBuilder users!"
www.pagesnip.com - "Print and Save the Web, just the way you want it!"
www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
and Forms - Now with PNG support!
www.lansrad.com - "Intelligent Solutions for Universal Problems"
www.fotokiss.com - "World's Best Auction Photo Editor"
-------------------------------------------------------------------------------------------------------

NewsArchive
04-28-2014, 04:05 AM
Nev,

> On install does SB7/8 remember in the registry where the %InstallDir%
> is located? The reason is that some techs have placed my app folder
> not in my approved location and when updates are required the install
> wants to install in the folder I designate and not where the tech has
> located it. If SB8 saves the InstallDir and I can retrieve and insert
> that as the Install directory, it would be quite useful. Any ideas?

SetupBuilder handles this automatically (if the "Add/Remove Programs
Support" option is enabled in the "General Information" Visualizer) and
supports the standard Windows registration method.

The "Detect Previous Version..." script function lets you retrieve the path
of a previously distributed version, the full uninstall string (for
automatic uninstall) and the installed version number.

Friedrich

NewsArchive
04-28-2014, 11:10 AM
Thanks Charles. That is exactly where I put it.
Nev

NewsArchive
04-28-2014, 11:10 AM
Thanks Friedrich.
I do not use windows registration, but the method as described by others
worked a treat.
Nev

NewsArchive
04-28-2014, 11:11 AM
> Thanks Friedrich.
> I do not use windows registration, but the method as described by others
> worked a treat.

So you do NOT have "Add/Remove Programs Support" enabled in the "General
Information" Visualizer?

Friedrich

NewsArchive
04-28-2014, 11:11 AM
This is the default (enabled) and recommended by the Windows development
guidelines.

Friedrich

NewsArchive
04-29-2014, 01:41 AM
Yes. All of those are in the installer.
Nev

NewsArchive
04-29-2014, 01:42 AM
> Yes. All of those are in the installer.

Okay, then you register your program with Windows and all the information is
already there. You can use the "Detect Previous Version..." script function
to retrieve the path of a previously distributed version, the full uninstall
string (for automatic uninstall) and the installed version number. No need
to write anything to the registry, it's handled automatically.

Friedrich