View Full Version : Eeek - my app has disappeared
NewsArchive
09-20-2012, 02:38 AM
My app has disappeared along with all my data. I know why but need an urgent
fix. I have to say it is probably of my own making.
Following JP's advice (and I am not blaming him <g>) I created a custom
uninstall. I tested it rigorously in all scenarios and it worked fine.
Pretty simple stuff:
! Get the registry install and data paths
Set Variable %INSTALL_PATH% to FUNCTION:Get Registry Key Value("Install
Path") from "HKEY_LOCAL_MACHINE\Software\Ambrit Software\Dentists Manager"
Set Variable %INSTALL_DATA_PATH% to FUNCTION:Get Registry Key Value("Data
Folder") from "HKEY_LOCAL_MACHINE\Software\Ambrit Software\Dentists Manager"
! --- Process uninstall queue ---
Process Uninstall Queue
! Delete the remaining folders and files including registry entries
Delete Tree "%INSTALL_PATH%"
Delete Tree "%INSTALL_DATA_PATH%"
Edit Registry (Remove key and all subkeys) "HKLM\Software\Ambrit
Software\Dentists Manager"=
Edit Registry (Remove key and all subkeys) "HKCU\Software\Ambrit
Software\Dentists Manager"=
The thing is I performed a web update within my app. This closed down my
application as it should but failed at about 75%. No idea why but that's not
important. SB asked me if I wanted to rollback the changes to which I said
YES as you would.
When this has happened before (without a custom uninstall) it was not a
problem but now the custom uninstall has clearly been actioned and has done
what it should I suppose.
So how do I prevent this custom uninstall running in a scenario where there
is a rollback?
Friedrich, I know you do not support custom un installs but I did not change
the standard one created by SB other than wrapping the Process Uninstall
Queue with the lines.
Many thanks
John
NewsArchive
09-20-2012, 02:39 AM
Hi John,
> My app has disappeared along with all my data. I know why but need an
> urgent fix. I have to say it is probably of my own making.
Yes, it's of your own making ;-) You instruct the uninstall to remove the
database folder tree, etc. whenever the uninstall processes uninstall
actions.
> So how do I prevent this custom uninstall running in a scenario where
> there is a rollback?
See attached screenshot. Check if the uninstall is running in "smart
rollback" mode. If this is the case (%ROLLBACK_MODE% variable is set to
"1"), do not execute your custom uninstall stuff.
Friedrich
NewsArchive
09-20-2012, 02:40 AM
Or this (see attached screenshot) in your custom uninstall script:
Friedrich
NewsArchive
09-20-2012, 02:40 AM
Thanks Friedrich - I wonder if JP is aware of this!!
John
NewsArchive
09-20-2012, 02:41 AM
Now he is ;)
Thanks both for this tip
--
JP
__________________________________________________ _____
For those who do not understand ... : "Qui bene amat bene castigat."
__________________________________________________ _____
DMC - Data Management Center : a tool to let you Migrate Import Export
Transfer your Data
www.dmc-fr.com
NewsArchive
09-20-2012, 02:41 AM
Hello Fredrich,
You mean this as custom uninstall script ?
!
//////////////////////////////////////////////////////////////////////////////////////////////////
#pragma UNINSTALL = "1"
Set Variable %ROLLBACK_MODE% to "0"
Set Variable %UNINSTALL_COMMANDLINE% to FUNCTION:Get System
Info(Command Line)
If %UNINSTALL_COMMANDLINE% Contains "/UR" Then
Set Variable %ROLLBACK_MODE% to "1"
End
If %_SB_INSTALLERFLAG% Does Not Equal "1" on Position
"$SB_SILENTMODEFLAG$" Then
Display Message Box "#UNINST_CONFIRM#" -- "#UNINST_HEADING#"
Else
Set Variable %_SB_RETURN% to "$IDYES$"
End
If %_SB_RETURN% Equals "$IDYES$" Then
! Get registry values on PATHS
Set Variable %INSTALL_PATH% to FUNCTION:Get Registry Key
Value("Directory Installation") from
"HKEY_LOCAL_MACHINE\SOFTWARE\CGF\Data Management Center"
Set Variable %INSTALL_DATA_PATH% to FUNCTION:Get Registry Key
Value("Directory Data") from "HKEY_LOCAL_MACHINE\SOFTWARE\CGF\Data
Management Center"
! --- Process uninstall queue ---
Process Uninstall Queue
! Delete all folders and keys
Delete Tree "%INSTALL_DATA_PATH%"
Delete Tree "%INSTALL_PATH%"
Edit Registry (Remove key and all subkeys) "HKCU\SOFTWARE\CGF"=
Edit Registry (Remove key and all subkeys) "HKLM\SOFTWARE\CGF"=
If %_SB_ERRORCODE% Equals "0" And %_SB_INSTALLERFLAG% Does Not Equal
"1" on Position "1" Then
Display Message Box "#UNINST_FINISH#" -- "#UNINST_HEADING#"
End
End
Merci
(cheking to be sure I do not do a blunder)
--
JP
__________________________________________________ _____
For those who do not understand ... : "Qui bene amat bene castigat."
__________________________________________________ _____
DMC - Data Management Center : a tool to let you Migrate Import Export
Transfer your Data
www.dmc-fr.com
NewsArchive
09-20-2012, 04:07 AM
Hi JP,
As far as I can see, you only set the %ROLLBACK_MODE% value, but you do not
really "use" it.
For example, if you don't want to execute your custom uninstall actions in
case of a smart rollback scenario:
If %ROLLBACK_MODE% Does Not Equal "1" Then
! Delete all folders and keys
! Yada yada
End
Friedrich
NewsArchive
09-20-2012, 04:07 AM
So now it looks like this :
#pragma UNINSTALL = "1"
Set Variable %ROLLBACK_MODE% to "0"
Set Variable %UNINSTALL_COMMANDLINE% to FUNCTION:Get System
Info(Command Line)
If %UNINSTALL_COMMANDLINE% Contains "/UR" Then
Set Variable %ROLLBACK_MODE% to "1"
End
If %_SB_INSTALLERFLAG% Does Not Equal "1" on Position
"$SB_SILENTMODEFLAG$" Then
Display Message Box "#UNINST_CONFIRM#" -- "#UNINST_HEADING#"
Else
Set Variable %_SB_RETURN% to "$IDYES$"
End
If %_SB_RETURN% Equals "$IDYES$" Then
! Get registry values on PATHS
Set Variable %INSTALL_PATH% to FUNCTION:Get Registry Key
Value("Directory Installation") from
"HKEY_LOCAL_MACHINE\SOFTWARE\CGF\Data Management Center RT"
Set Variable %INSTALL_DATA_PATH% to FUNCTION:Get Registry Key
Value("Directory Data") from "HKEY_LOCAL_MACHINE\SOFTWARE\CGF\Data
Management Center RT"
! --- Process uninstall queue ---
Process Uninstall Queue
! Delete all folders and keys
If %ROLLBACK_MODE% Does Not Equal "1" Then
Delete Tree "%INSTALL_DATA_PATH%"
Delete Tree "%INSTALL_PATH%"
Edit Registry (Remove key and all subkeys) "HKCU\SOFTWARE\CGF"=
Edit Registry (Remove key and all subkeys) "HKLM\SOFTWARE\CGF"=
End
If %_SB_ERRORCODE% Equals "0" And %_SB_INSTALLERFLAG% Does Not Equal
"1" on Position "1" Then
Display Message Box "#UNINST_FINISH#" -- "#UNINST_HEADING#"
End
End
Sorry fir the bother but trying to understand
BTW what does UR/ mean please ?
I did not know the commandline was used for an uninstall so "grasping"
your tips here
--
JP
__________________________________________________ _____
For those who do not understand ... : "Qui bene amat bene castigat."
__________________________________________________ _____
DMC - Data Management Center : a tool to let you Migrate Import Export
Transfer your Data
www.dmc-fr.com
NewsArchive
09-20-2012, 04:08 AM
Hi JP,
>
> So now it looks like this :
>
Looks good :) This will not execute the custom uninstall actions if the
uninstall is running in "rollback" mode.
> Sorry fir the bother but trying to understand
> BTW what does UR/ mean please ?
> I did not know the commandline was used for an uninstall so "grasping"
> your tips here
/UR is the command line switch that lets you set the uninstall into smart
rollback mode (see attached screenshot). The installer uses this switch to
rollback a "failed" install.
Friedrich
NewsArchive
09-20-2012, 04:09 AM
Merci Monsieur
So the uninstaller is run from command line from the add remove
programs ?
Reading the advanced tab in project properties I am wondering :
option : 'remove installer after successful Installation'
option : 'remove uninstaller after successsful Installation'
is there not something wrong on this second option ?? I do not
understand why one would want to remove the uninstaller after a
successful INSTALLATION ?
should it not be uninstallation ? ;o)
--
JP
__________________________________________________ _____
For those who do not understand ... : "Qui bene amat bene castigat."
__________________________________________________ _____
DMC - Data Management Center : a tool to let you Migrate Import Export
Transfer your Data
www.dmc-fr.com
NewsArchive
09-20-2012, 04:09 AM
Hi JP,
> So the uninstaller is run from command line from the add remove programs ?
No, the uninstall is not run from command line (but you can do this). The
uninstall accepts (and supports) command line switches.
> Reading the advanced tab in project properties I am wondering :
>
> option : 'remove installer after successful Installation'
> option : 'remove uninstaller after successsful Installation'
>
> is there not something wrong on this second option ?? I do not understand
> why one would want to remove the uninstaller after a successful
> INSTALLATION ?
>
> should it not be uninstallation ? ;o)
No, it should not be "uninstallation". This option removes the uninstall
..exe/.log if the INSTALLATION succeeded. For example, if you have to
provide a permanent (non-uninstallable) "hot-fix" for an existing
application and you would like to support rollback capability (in case the
install failed). Then you enable this option.
Friedrich
NewsArchive
09-20-2012, 04:10 AM
Oh I see.
So many "cases" in there you take care off ... <g>
--
JP
__________________________________________________ _____
For those who do not understand ... : "Qui bene amat bene castigat."
__________________________________________________ _____
DMC - Data Management Center : a tool to let you Migrate Import Export
Transfer your Data
www.dmc-fr.com
NewsArchive
09-20-2012, 04:11 AM
Friedrich - this is MY mistake and certainly not a SB bug in any respect.
However, do you not think that this bit of code should be included in the
default SB script when creating a custom uninstall?
My fault again but I have never tested a rollback scenario with a custom
uninstall. Just never occurred to me. But I would like to bet that the
majority of SB users haven't either and it is a potentially major disaster
waiting to strike.
So adding it to the custom uninstall skeleton code might at least make
people aware.
What do you think?
Thanks
John
NewsArchive
09-20-2012, 04:12 AM
John,
When a user UNINSTALL an application what does he expect ?
If the UNINSTALLER chokes what does he expect ?
If YOU add a delete tree to your CUSTOM UNINSTALLER how could the
rollback KNOW about this ADDED code ?
Correct it would be cool to have this mentioned in docs or even added
in the default script provided when we create a custom uninstaller but
this is NOT (to my eyes) a "major disaster" case.
You tested an uninstaller on your LIVE machine - this is a "major
error" in my eyes ;)
Always test in virtual machines
I NEVER install on my LIVE machine (my scripts)
I NEVER UNINSTALL on my LIVE machine (my scripts)
because I know it will CHANGE my machine to a "lambda" user's machine
state and this I do not want.
See what I mean John ? ;-)
--
JP
__________________________________________________ _____
For those who do not understand ... : "Qui bene amat bene castigat."
__________________________________________________ _____
DMC - Data Management Center : a tool to let you Migrate Import Export
Transfer your Data
www.dmc-fr.com
NewsArchive
09-20-2012, 04:12 AM
No JP I did not test on a LIVE machine. That would be silly <g> Probably
just my choice of words made it sound like that.
My only intention has been to point out to the SB community that if you do
not take into account a rollback on a custom uninstall then it could remove
everything on a live machine out there. That of course is out
responsibility not Friedrichs.
How many people have customs uninstalls that check for this scenario? Not
many I bet.
But I still think Friedrich should consider putting the code in the skeleton
custom install code perhaps. His choice.
But sorry JP this IS a major major potential disaster. Not for us but our
clients. If they perform an upgrade and it fails and they get the rollback
scenario then if you are removing the code and data they will lose it all.
John
NewsArchive
09-20-2012, 05:16 AM
> Oh I see.
> So many "cases" in there you take care off ... <g>
<G> Yes, so many possible completely different deployment scenarios :-)
Fresh installs, updates, upgrades, hot-fixes, patches, reinstalls, repairs,
uninstalls , etc. <g>
Friedrich
NewsArchive
09-20-2012, 05:17 AM
Errrr John,
If the user performs an UPGRADE did you say ?
Where in the UPGRADE does the UNINSTALLER come in play ?
(maybe i'm missing something here)
The roolback comes in play if the upgrade fails and I do not see the
"link" between the roolback and the uninstaller (with our addition)
I would understand the UNINSTALLER fails and a roolback happens then
etc ...
I had read your question as I did an UNINSTALL and this failed so
rollback etc ...
maybe I am totaly lost here ;)
:-?
--
JP
__________________________________________________ _____
For those who do not understand ... : "Qui bene amat bene castigat."
__________________________________________________ _____
DMC - Data Management Center : a tool to let you Migrate Import Export
Transfer your Data
www.dmc-fr.com
NewsArchive
09-20-2012, 05:17 AM
I might be missing the point also <g>
You upgrade a users system using "wupdate.exe". The install fails for
whatever reason (in my case probably an internet connection". SB kicks in
and says do you want to perform a rollback.
At that stage the uninstaller runs to go back to the previous version I
would assume BUT that uninstaller has the custom uninstall embedded in it.
It is when that runs the problem occurs.
John
NewsArchive
09-20-2012, 05:18 AM
BTW JP maybe this is where the misunderstanding is also ....
In the case of a FULL install you want your Uninstaller to take everything
out so you want the Custom Uninstall to run.
In the case of an UPGRADE and a rollback you want the uninstaller to run (to
backtrack on what is has done so far) BUT you do NOT want the custom
uninstall element to run in this scenario.
HTH
John
NewsArchive
09-20-2012, 05:18 AM
John,
I did NOT add my custom unisnatller to my UPGRADE script (of course)
maybe this is where you went wrong ...
--
JP
__________________________________________________ _____
For those who do not understand ... : "Qui bene amat bene castigat."
__________________________________________________ _____
DMC - Data Management Center : a tool to let you Migrate Import Export
Transfer your Data
www.dmc-fr.com
NewsArchive
09-20-2012, 05:19 AM
Ah hah. I use the same script for a full install or an upgrade. It detects
an existing application at runtime and installs the relevant files.
Hence why.
John
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.