PDA

View Full Version : Custom Uninstall bug?



NewsArchive
04-07-2009, 01:51 AM
I created a custom uninstall script for the first time. Great feature!

The manual has a very good description of how to start up the customized
uninstall .sbi script. I had that initialized within a few seconds.
However, the manual is silent on the subject of what information (from
the install script) is available to the uninstall .sbi script at
uninstall time.

Realizing the uninstall script is compiled into a separate program from
the install, the first thought that came to mind was to use only
compiler variables. However, compiler variables can be

I set up a compiler variable [FILEPATH] in the .sbi. In the #include
directive, I configured [FILEPATH] with the value %FILEPATH%, which at
the point in the script where the #include is coded, contains a path to
a file my script wishes to delete. To my surprise, [FILEPATH] was
compiled into the .sbi as the string "%FILEPATH%". Not very useful at
uninstall time. <g>

Conclusion: This technique does not work with an uninstall .sbi.

Some words in the manual would be helpful as to when and how to use
"Include Script Compiler Variable configuration". (Something more than
"[in]") I don't know enough at present to know whether the above is a
bug or is working as intended.

I next removed the #set directive from the .sbi, reopened the project
and defined the [FILEPATH] compiler variable in the project definition
section. (With the value %FILEPATH%) With limited testing, this seems
to work. However, it occurs to me that the actual path in [FILEPATH] is
not known until installation time, so am curious how this actually worked!

The most certain method appears to be to store paths under keys in the
system registry, which my script will interrogate and use just before
the uninstaller removes the keys.

BTW, I am testing on 64 bit Windows 7. Your 2558 release message says"
> There is still one tricky Win64 uninstall bug to be fixed in SB6.

My Win 7 64 bit uninstalls seem to work fine with Clarion 7, except,
unless I first manually unregister all templates belonging to the
install I get an error message for each of the registered templates.
OTOH, responding "ok" to each error message is quicker and easier than
manually unregistering in Clarion 7! <g>

What should I be looking for wrt 64 bit uninstall?

--
Phil Carroll
http://www.enablingsimplicity.com

NewsArchive
04-07-2009, 01:51 AM
Hi Phil,

> My Win 7 64 bit uninstalls seem to work fine with Clarion 7, except,
> unless I first manually unregister all templates belonging to the
> install I get an error message for each of the registered templates.
> OTOH, responding "ok" to each error message is quicker and easier
> than manually unregistering in Clarion 7! <g>

SetupBuilder does *not* display error messages during the Clarion template
unregistration process. So I assume, it comes from the Clarion environment.

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
04-07-2009, 01:52 AM
Hi Phil,

>
>I created a custom uninstall script for the first time. Great feature!
>

Thank you :)

> Realizing the uninstall script is compiled into a separate program from
> the install, the first thought that came to mind was to use only compiler
> variables. However, compiler variables can be
>
> I set up a compiler variable [FILEPATH] in the .sbi. In the #include
> directive, I configured [FILEPATH] with the value %FILEPATH%, which at the
> point in the script where the #include is coded, contains a path to a file
> my script wishes to delete. To my surprise, [FILEPATH] was compiled into
> the .sbi as the string "%FILEPATH%". Not very useful at uninstall time.
> <g>
>
> Conclusion: This technique does not work with an uninstall .sbi.

"%FILEPATH%" is only displayed if you do not give that variable a value at
runtime. Where in your uninstall .sbi do you give %FILEPATH% a value?

Please note, the main .sb6 (generates INSTALL.EXE) and the uninstall .sbi
(generates UNINSTALL.EXE) are completely different applications. So if you
set a variable value in the script that compiles your INSTALL.EXE, this
value is not available in the UNINSTALL.EXE!

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
04-07-2009, 03:13 AM
Hi Phil,

> SetupBuilder does *not* display error messages during the Clarion template
> unregistration process. So I assume, it comes from the Clarion
> environment.

I think you are talking about this error message (see attached screenshot),
right?

This message box is displayed from the Clarion tool. Something in the
Clarion 7 unregistration process changed and this message box (and another
message) will be displayed if a SB6 or SB7 (beta) installer handles
automatic C7 template unregistration.

We have changed the SB6 and SB7 runtime now to prevent this in the future.
This will be part of the next SB6 maintenance build and the next SB7 beta.

All SB6/SB7 installers that handle C7 template un-/registration will have to
be recompiled!

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
04-08-2009, 01:27 AM
Yes, that is exactly the message. I realized that is a Clarion message.
I did not intend to imply it was an SB message.

I'm glad you found a way to avoid it. I was afraid it might be
unavoidable with Clarion 7.

--
Phil Carroll
http://www.enablingsimplicity.com

NewsArchive
04-08-2009, 01:27 AM
What is the best way for an uninstall script to determine its own path?


A Clarion 3rd party uninstall can't know the uninstall path a priori, if
the install uses Clarion Environment Detection to set the uninstall path.

I have tried several things and come up empty.

--
Phil Carroll
http://www.enablingsimplicity.com

NewsArchive
04-08-2009, 01:28 AM
Hi Phil,

>
> What is the best way for an uninstall script to determine its own path?

You can use %_SB_INSTALLDIR% to determine its own path.

And of course, you can use "Get System Info (Installer Path Name)" to
retrieve the full pathname, excluding the file name, of the (un)installation
currently executing.

You can use all functions from the "Script Functions" list in an uninstall
application.

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
04-08-2009, 01:29 AM
I have run into another unanswered question. (I had not thought this
through deeply enough until considering uninstall issues.)

Suppose customer John Doe installs into three versions of Clarion. Will
John have three entries in the add/remove programs list, or only one?
How are they told apart? How can my script cause them to be listed
differently? Such as:
Fantastic Killer addition to Clarion 7
Fantastic Killer addition to Clarion 6
Fantastic Killer addition to Clarion 5.5

Or, does only one entry appear in the add/remove list? The last one
installed?

BTW, the things I tried unsuccessfully wrt trying to determine the
location of an executing uninstall script:
%CURDIR% - contains "C:\Windows\System32" (not where exe resides)
{CURDIR} - also contains "C:\Windows\System32"
The result variable is empty after the following search for file:
file name: *.*
path to search: .\
search depth: 1
return list of all matches checked
--
Phil Carroll
http://www.enablingsimplicity.com

NewsArchive
04-08-2009, 01:29 AM
Last one Phill
Trying the PDF SDK installers now and looking at exactly one add remove entry BECAUSE the GUID is the same

Think remembering there was a solution given for this sometime back but I would suggest the links BEING different and pointing to different locations those work perfectly

add remove is another story .....

Cordialement - Best regards
Jean-Pierre GUTSATZ

CGF

DMC - Data Management Center
A tool to let you Migrate Import Export Transfer your Data
www.dmc-fr.com
Certified by Microsoft : "Works with Vista" &
"Works with Windows Server 2008"

NewsArchive
04-08-2009, 01:30 AM
So there is only one entry per GUID in the add/remove list?

Then I would need a different GUID for each Clarion version in order to
have an entry in the list for each. I don't know how to accomplish that.

However, the uninstall exe appears in three places in my example. If I
have only one GUID, then the user would need to uninstall by navigationg
to and executing exes directly, not by using the add/remove list?

--
Phil Carroll
http://www.enablingsimplicity.com

NewsArchive
04-08-2009, 01:31 AM
Yes Phill uninstalling by links works perfectly of course becasue that points to an uninst and a log file
the guids ..... dynamically changed.....is another story but I am sure tomorrow Friedrich will come out with something for this

Cordialement - Best regards
Jean-Pierre GUTSATZ

CGF

DMC - Data Management Center
A tool to let you Migrate Import Export Transfer your Data
www.dmc-fr.com
Certified by Microsoft : "Works with Vista" &
"Works with Windows Server 2008"

NewsArchive
04-08-2009, 01:31 AM
> but I am sure tomorrow Friedrich will come out with something for this

doesn't he always? <gg>
--
Phil Carroll
http://www.enablingsimplicity.com

NewsArchive
04-08-2009, 01:32 AM
Phil,

>I have run into another unanswered question. (I had not thought this
>through deeply enough until considering uninstall issues.)
>
> Suppose customer John Doe installs into three versions of Clarion. Will
> John have three entries in the add/remove programs list, or only one? How
> are they told apart? How can my script cause them to be listed
> differently? Such as:
> Fantastic Killer addition to Clarion 7
> Fantastic Killer addition to Clarion 6
> Fantastic Killer addition to Clarion 5.5
>
> Or, does only one entry appear in the add/remove list? The last one
> installed?

In Windows, the above entries in the Add/Remove Control Panel would be
based on different Product "GUIDs". This is an unique identifier string
that is bound to each installer package.

In other words, to have three entries in the Add/Remove Panel, you need
three different Product GUIDs. Other installation products do not allow
the use of different Product GUIDs in the same setup.exe. In SetupBuilder,
you can use different GUIDs from the same installer to create different
Add/Remove Panel entries and different uninstalls.

Similar to this method:
http://www.lindersoft.com/forums/showthread.php?p=18156&highlight=guid#post18156

See attached screenshot and quick-and-dirty "MultiGUID.sb6" demo project.
The setup can create three different "Add/Remove" control panel entries
(different products based on different GUIDs) from the same installer. The
only problem is that the default uninstall displays %PRODUCTNAME% as product
name in the "Are you sure you want to remove <Productname>) message box. So
you have to use a custom uninstall to solve this.

> BTW, the things I tried unsuccessfully wrt trying to determine the
> location of an executing uninstall script:
> %CURDIR% - contains "C:\Windows\System32" (not where exe resides)
> {CURDIR} - also contains "C:\Windows\System32"
> The result variable is empty after the following search for file:
> file name: *.*
> path to search: .\
> search depth: 1
> return list of all matches checked

You can use %_SB_INSTALLDIR% or "Get System Info (Installer Path Name)"

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
04-09-2009, 01:38 AM
> You can use %_SB_INSTALLDIR% or "Get System Info (Installer Path Name)"

Thanks Friedrich. Both of those work great. As well as some compiler
variables based on %_SB_INSTALLDIR%.

My installer script allows the user to change the default install path
to anywhere he likes, using the Select Install Folder dialog, so could
be anywhere. I assumed that this path could not possibly be compiled
into the uninstaller, but I see I was wrong. It is obviously compiled
in as a symbolic reference.

--
Phil Carroll
http://www.enablingsimplicity.com

NewsArchive
04-09-2009, 01:38 AM
So, if I understand this correctly, both [PRODUCTNAME] and [PRODUCTGUID]
can be changed at install time, but must be changed before the Create
Installation Log statement. Correct?

So, then the uninstaller resolves these symbols using the log at
uninstall time?

Are there any other symbols that are bound this late?

--
Phil Carroll
http://www.enablingsimplicity.com

NewsArchive
04-09-2009, 01:39 AM
Phil,

> So, if I understand this correctly, both [PRODUCTNAME] and [PRODUCTGUID]
> can be changed at install time, but must be changed before the Create
> Installation Log statement. Correct?
>
> So, then the uninstaller resolves these symbols using the log at
> uninstall time?
>
> Are there any other symbols that are bound this late?

Please note that [PRODUCTNAME] and [PRODUCTGUID] are "compiler variables".
They are processed at compile time. So in a "standard" installation, the
Product Name and the Product GUID are set at compile time.

What I did in the example is, I assigned runtime variables to the above
compiler variables (see attached screenshot). The runtime variables are
then resolved at installer runtime. In other words, we do not define the
Product Name and the Product GUID at compile time, but at installer runtime.

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
04-09-2009, 01:40 AM
The variable GUID support works great. I just tried it out in my own
script.

Because my installers install into various Clarion versions, but have
only one product per install, I set it up a little differently from your
example.

I have a compiler variable [PRODUCT_NAME] defined with a generic product
name. [PRODUCTNAME] is defined as "[PRODUCT_NAME] for %CVER%".

%CVER% is set to the value returned from the Clarion Environment
Detection dialog.

I set many dialogs to use [PRODUCT_NAME] (including the uninstaller)
instead of using [PRODUCTNAME]. Those that appear after environment
detection are left to use [PRODUCTNAME].

HOWEVER

However, I just noticed something strange. The Clarion Environment
Detection dialog has disappeared from the list of available dialogs.
See separate message.
--
Phil Carroll
http://www.enablingsimplicity.com

NewsArchive
04-09-2009, 01:41 AM
> However, I just noticed something strange. The Clarion Environment Detection dialog has disappeared from the list of available dialogs. See separate message.

Never mind. When I loaded your multi-GUID example, it evidently turned
off Clarion support. Although my Clarion Environment Detection dialog
remained (and still worked), it had "unknown type" in the dialog
definition, and CED had disappeared from the list of available dialogs.

Whew.
--
Phil Carroll
http://www.enablingsimplicity.com