Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Creation/Replacing of registry key during uninstal


30 replies to this topic

SinDos

SinDos
  • Full Members
  • 25 posts

Posted 31 October 2007 - 09:03

Hello

I have problem with a registry key replacing.

PREHISTORY.
We have two installed versions of product "AppSpecific" (1.0 and 2.0).
The product installation sets some keys in the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany\AppSpecific\1.0
and
HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany\AppSpecific\2.0

Also have common key for active version (last installed):
HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany\AppSpecific\Exec\AppSpecific
the key has value: "Active"= "2.0"
The key and value is used by another application for some aim (console running for example).

So, user try to uninstall 2.0 (active version) and I must to scan all installed versions, ask user (per AskOptions dialog) about version of the application which he wants to use for connection with another application.
Then change HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany\AppSpecific\Exec\AppSpecific:
"Active"= "2.0" to "Active"= "1.0"

I can change it but the uninstallation removes the key.

How I can exclude the key removing?
PS. the key is created by installation of the application

Thank you.


SinDos

SinDos
  • Full Members
  • 25 posts

Posted 31 October 2007 - 10:08

in other words,
how I can create a registry key which cannot be deleted during uninstallation.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 31 October 2007 - 10:15

Did you mark the key as shared?

SinDos

SinDos
  • Full Members
  • 25 posts

Posted 31 October 2007 - 10:20

No, because I create the key through specific InstallScript function.
I know where the Registry Flags can be set,
but how I can do it in script

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 31 October 2007 - 11:20

I guess you can't do this in script.

SinDos

SinDos
  • Full Members
  • 25 posts

Posted 01 November 2007 - 05:32

OK, other way.
I try to create the key and value whereby UI:
- Create a key. Now I CAN change the flag:
1. Install Only (+) [my need]
2. UnInstall entire key(-)
3. Install if absent, uninstall if present (*)
- try to add string value. The flag is discarded and
now I can set the flag 2 or 3 ONLY
(see attached bitmaps)

Is it bug or my mistake?

Attached Images

  • CanFlag.png


SinDos

SinDos
  • Full Members
  • 25 posts

Posted 01 November 2007 - 05:32

other bitmap

Attached Images

  • CannotFlag.png


SinDos

SinDos
  • Full Members
  • 25 posts

Posted 01 November 2007 - 08:46

One more:
I cannot understand how the flags is working??
First, why/when one of the flags is disabled
Second, I tried to set "Install Only" , no expected result....

Please help

SinDos

SinDos
  • Full Members
  • 25 posts

Posted 01 November 2007 - 08:56

All that I want to do is to add a key and value for the key which won't be removed after uninstallation.

How?

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 01 November 2007 - 11:10

From your screen shots it looks like you are building an MSI setup, not a InstallScript setup. Which project type are you actually using?

SinDos

SinDos
  • Full Members
  • 25 posts

Posted 02 November 2007 - 04:48

Ohh, yes. Big sorry, I need to move the question to appropriate topic.

- InstallShield "InstallScript MSI" Projects
- InstallShield "Basic MSI" Projects
Stefan, which topic is apropriate for my question?

once again, big sorry

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 02 November 2007 - 13:26

It depends on your project type. Are you using "Basic MSI" or "InstallScript MSI"?

SinDos

SinDos
  • Full Members
  • 25 posts

Posted 06 November 2007 - 09:34

Basic MSI Project

SinDos

SinDos
  • Full Members
  • 25 posts

Posted 06 November 2007 - 09:55

I use IS12 (Direct Edit Mode) for creation of merge module database (msm file).
I use the msm file for building of full CD for all my products.

Basic MSI Project is using for creation installation (+ prerequisites, custom actions etc)

in the largest accounts I would add all the registry transformation to msm module

is it possible? or only in MSI project

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 06 November 2007 - 11:59

I'm moving this thread to the Basic MSI section of the forum, which is also applicable to MSMs.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 06 November 2007 - 12:03

For the shared registry entry, create a component and make sure this component has the identical ComponentId GUID in all projects. This should ensure proper ref-counting. We are talking about a shared registry *entry* (value), not a shared key (folder symbol in RegEdit), right?


SinDos

SinDos
  • Full Members
  • 25 posts

Posted 08 November 2007 - 04:54

>This should ensure proper ref-counting. We are talking about a shared
>registry *entry* (value), not a shared key (folder symbol in RegEdit), right?
Confusing for me....

My msm project contains all required keys and values.
I added custom action (script) to MSI project which scans the registry,
raise ASKOptionDlg and ask user about active version after uninstallation,
then the script change value for specific key to selected by user.
I debug the script and it is working during uninstallation,
but after the process the key is removed all the same.

So I would keep the key (with changed value) after uninstallation.
What I need to do?

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 10 November 2007 - 12:38

We may still be talking about different things here. To clarify: there are three items in registry, not sure what they are called in English regedit. Let's call them key (the folder symbol in the left pane in regedit), entry (either (Default) or a named entry) and value (the value of the entry). In a .reg file this would be:
[The key]
The entry = The value

So if your entry is shared, even with different values (I think), it should be properly refcounted if the component GUID is identical. Please double check the log to see what Windows Istaller has to say about this component.

SinDos

SinDos
  • Full Members
  • 25 posts

Posted 12 November 2007 - 08:54

OK, applied mark for the things.

Just small specifics of my installation:
Firstly I create MSM file. The file contains some components.
One of the components has keys (see "InstallComp.png")
I must to keep the entry ("CurrentVersion") but change its value (one of versions which still are installed)

Second
Then I add the msm file to MSI project as merge module ("MSIMerge.png")
Also I added custom action to the MSI project (scanning of the registry, user asking and modification of the entry value)

So, what and how I need to specify for the entry in msm project?

Sorry for my flusters.

Attached Images

  • InstallComp.png


SinDos

SinDos
  • Full Members
  • 25 posts

Posted 12 November 2007 - 08:55

In MSI project

Attached Images

  • MSIMerge.png


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 13 November 2007 - 08:56

I believe you're doing everything right, this should work as intended. Please look at the log to see what might go wrong.

BTW I wonder why you're not using the full InstallShield 12 IDE user interface but instead use the ancient "InstallShield for Windows Installer 2.x" view style.

SinDos

SinDos
  • Full Members
  • 25 posts

Posted 20 November 2007 - 08:01

Now I'm trying create the msm and msi projects from scratch
(originally the progects was created by special program and I only modified
some components, attributes ....)

I'll add the registry keys (and entry+value with required flags) in msm project
then add custom action (script) in msi project for the values modification.

Stefan is it correct way?

>BTW I wonder why you're not using the full InstallShield 12 IDE
>user interface but instead use the ancient "InstallShield for
>Windows Installer 2.x" view style.
how I can change the UI style?

Edited by SinDos, 20 November 2007 - 08:02.


SinDos

SinDos
  • Full Members
  • 25 posts

Posted 20 November 2007 - 10:05

Required keys and entries are added.
The keys have "Install Only" flag

The keys are created during installing but removed after uninstalling.

Stefan may be it is bug in the software?

I have not idea what I do wrongly!


I'll try one more way:
I'll remove the keys from msm project
and try to create it by custom action (script) for installation stage and
another script for the keys modification during uninstallation

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 23 November 2007 - 01:11

I don't know what's going on here. I highly recommend a log to see why Windows Installer removes the shared component.

You can change the InstalShield IDE layout in Tools > Options.

m.nouryan

m.nouryan
  • Full Members
  • 23 posts

Posted 27 November 2007 - 19:14

I am not sure how much this would help:

I have had similar problem long time ago (with an InstallShield Script project), apparently InstallShield logs all the registry creations in the script so it can remove them during un-install (and this was exactly what I DID NOT want to happen).

You may disable the logging using:

Disable(LOGGING);
////Create/Modify registry
Enable(LOGGING);


I am not sure if this would help your case but your symptoms sound familiar to me, anyway it's worth a try.

Regards,
M. Nouryan


Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 27 November 2007 - 22:36

About the missing option in the InstallShield UI, about the greyed items - If I recall correctly:
Add a string value without a name to the registry key - the value will be named "(Default value)". After doing so the third option should be available. Note: the data in this value is not important.
Background: the special collaboration between the columns Name and Value in the registry table. See http://msdn2.microso...y/aa371168.aspx

Edited by Zweitze, 27 November 2007 - 22:39.


roopesha2

roopesha2
  • Full Members
  • 7 posts

Posted 18 September 2008 - 10:33

Hi

I have two problems

1.)Components marked SHARED by an installer have registry entries left behind in the windows registry when a product is uninstalled. Is there a way to force the deletion of these components on uninstall?


2.)We have a customer that wants to run a silent install of our msi. However, they want an exit code broadcast once the installer is finished installing successfully or if it fails. Is there a way to do this other than by using the log file?


Please suggest me the solutions.

Thanks


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 18 September 2008 - 11:01

1. Are the files of that same component removed, but registry entries left behind? Which entries? Did they exist before? Are yiu testing on a fresh clean image?

2. msiexec does return values for success, failure or user exit.

roopesha2

roopesha2
  • Full Members
  • 7 posts

Posted 18 September 2008 - 11:47


1)
Files are removing after uninstallation but registry entries are present.They are HKLM Registry entries.its not clean image.

2)How does i incorpoate in my msi because it is a silent installation.after successfull installation/failed installation it broadcast exit code.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 18 September 2008 - 11:52

I'm not sure what you mean with "broadcast".

msiexec.exe /i your.msi /q

will return 0 for success (if no reboot is required) or any of the error codes documented in MSI Help in case of failure or if a reboot is required (like 1603 for error, 1602 if user aborted the install).

roopesha2

roopesha2
  • Full Members
  • 7 posts

Posted 18 September 2008 - 12:01


For exit code broadcast i used Qn+ switch for installation it is working.