PDA

View Full Version : Shared File feature



thorax
11-08-2013, 01:42 PM
I have a few questions about the “Shared File” feature used to reference count files in SetupBuilder:

1) Does reference counting work on files other than DLL and EXE files?
2) If I reinstall an application (repair functionality), will this bump the reference count?
3) If the shared component requires a modification to the PATH variable, is there a way to reference count that? (i.e. Only when the shared component is uninstalled, the PATH modification is also removed)
4) Where are the reference counts stored if I wanted to examine or troubleshoot the install/uninstall process?

Thanks in advance.

Steve.

linder
11-09-2013, 03:09 AM
Steve,

The "Shared File" feature (Reference Count, aka refcounts) is not a SB specific feature. Reference count is a Windows operating system functionality.

In order for a file to be installed as a shared component, you must indicate to the setup program that the file is to be shared. Each time a shared component file is installed, the file is first copied, then a registry key value under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\SharedDLLs is created or incremented. The name of the key is the fully qualified installed location of the file, and the value is set to the number of times the component is installed.

Each time a shared component file is uninstalled, the same value that was created or incremented when it was installed is decremented. When a DLL-counted file is uninstalled and the decremented value reaches zero, the uninstallation program prompts the user to remove the component file.

Reference counting works on files other than DLL and EXE files. Modifications to the PATH variable are not related to Reference Count.

Hope this helps.

Friedrich

thorax
11-09-2013, 11:05 AM
Thanks Friedrich for the responses.

I'm thinking now that my shared component may be better suited as a SetupBuilder PreRequisite. You mention that user prerequisites can be created in http://www.lindersoft.com/forums/showthread.php?t=39996&highlight=prerequisite, but I can't find any mention of them in this forum, the Help or the PDF manual.

Is there an "accepted way" to create and add custom prerequisites to a SetupBuilder kit? Thanks again.

Steve.

linder
11-10-2013, 03:32 AM
Steve,

A SetupBuilder "Core" PreRequisite is an include script (.sbi) that contains the deployment logic and the original vendor files (runtimes or redistributables) needed to install distinct pieces of functionality for a product or technology framework. For example, Microsoft Visual C++ 2012 Redistributable.

To develop your own PreRequisite, just add the required deployment logic for your own components to a .sbi and add it to the main (.sb8) project via the #include compiler script item. As a starting point, you can use one of the standard "Core" PreRequisite include scripts. But you do not have to follow this model at all!

It is not mentioned in the Help or the PDF manual because a PreRequisite is nothing more than deployment logic code (whatever steps are required to deploy a specific component). It can be a PreRequisite that downloads a missing component from the Internet and installs and registers it, or it can be a redistributable that is embedded into the setup.exe and extracted/installed. Or a single-line PreRequisite to just install/register a single ActiveX component.

Friedrich