View Full Version : SB anomaly in MultiGuid/Name example
NewsArchive
06-16-2011, 12:44 AM
Friedrich,
I applied your example to my BoTpl templates, and it works great except for
the uninstall.
It is using the ProductName as hard wired instead of the variable in the
uninstall.
Image attached. Win7 ult 64 bit.
Can this be changed?
Best regards,
Bo
NewsArchive
06-16-2011, 12:45 AM
Hi Bo,
> I applied your example to my BoTpl templates, and it works great except
> for the uninstall.
> It is using the ProductName as hard wired instead of the variable in the
> uninstall.
> Image attached. Win7 ult 64 bit.
> Can this be changed?
Yes. Because you decide at runtime (and not at compile time) which Product
GUID to use, the uninstall does not have any product name information
available. So you have set %PRODUCTNAME% at runtime in the custom uninstall
script (similar to the attached screenshot from the LSZip custom uninstall).
What you do is the following:
1. You set a "standard" name for %PRODUCTNAME% (see Line 18).
2. You detect the path of the uninstall file (see Line 20).
3. You try to detect the installed Product GUIDs (see Line 22). %_SB_TMP%
holds the installation folder.
4. If this succeeds (Line 23) then you check if the installation path
(returned in %_SB_TMP%) "contains" the path of the uninstall. If this is
the case, set the "real" product name (e.g. Line 25).
Does this help?
Friedrich
NewsArchive
06-16-2011, 12:45 AM
Friedrich,
Hmmmmm, except I don't have a tab for an uninstall script.
Bo
NewsArchive
06-16-2011, 12:46 AM
Found it by digging more into the example.
Thanks, Friedrich.
Bo
NewsArchive
06-16-2011, 12:46 AM
Bo,
>
> Hmmmmm, except I don't have a tab for an uninstall script.
>
Then you do not have a custom uninstall <g>
To create a custom uninstall:
-> File | New... | Uninstall Include Script...
To add the custom uninstall to your project:
-> In the Script Editor, use #include script...
For example:
! --- Define commonly used constants ---
#include script "Common Definitions.sbi"
#include script "[SB_PROJECT]\CustomUninstall.sbi"
Does this help?
Friedrich
NewsArchive
06-16-2011, 12:46 AM
Friedrich
I added the scripts, change the guid's, names, etc, and now when trying to
uninstall, the uninstall app appears, asks for elevation, then just goes
away. Does not uninstall at all.
Bo
NewsArchive
06-16-2011, 12:47 AM
Bo,
> I added the scripts, change the guid's, names, etc, and now when trying to
> uninstall, the uninstall app appears, asks for elevation, then just goes
> away. Does not uninstall at all.
But why scripts (plural)? You only have to add one custom uninstall script
to handle it. If you are interested, just post your uninstall .sbi and I
can tell you what causes it.
Friedrich
NewsArchive
06-16-2011, 12:47 AM
I have attached a quick and dirty demo.
The uninstall will display "***THIS IS THE NEW NAME***" (defined in the
uninstall script) during the uninstall.
Does this help?
Friedrich
NewsArchive
06-16-2011, 12:48 AM
Friedrich,
Here is my script.
Bo
NewsArchive
06-16-2011, 01:07 AM
Bo,
>
> Darn it, wrong one, here it is.
>
Your custom uninstall works perfect. I have added your original
'multiguiduninstall.sbi' to the BoDemo.sb7 and the uninstall removes the
installed file (and itself) from C:\Program Files\BoDemo.
See attached project.
Friedrich
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.