Where in registry can I find the version of my installed application

Started by Randem, December 07, 2011, 02:46:45 PM

Previous topic - Next topic

Randem

Actually the AppId and the AppVersionName should match. The AppName does not have much to do with it.


Randem

To make the installation another application completely you have to change the AppName of the application in the script. All applications with the same AppName are the same application to Inno Setup

spick56

That's fair enough.  
 
I asked that question because after the 2nd installation of same program, at a different location, I couldn't see the initial installation entry in the registry or Control PanelAll Control Panel ItemsPrograms and Features.  
That means the only way to uninstall the initial program is to find the actual folder where it's installed and execute the unins000 program.
 
BTW thanks for pointing me to InnoScript documentation and (as always) thanks for your help on this topic.

Randem

It depends on whom created the installer and what they meant for it to do. If you mean InnoScript then we want the user to be able to have two different version on the computer at the same time. So it is not necessary to uninstall the prior version. Some programs require you to uninstall the prior version for they only want you to have one available version on your computer

spick56

Did I in my last post say Just one more question, actually I have one last, last question.
 
If for example user has a program installed in the default (c:\Program Files\...) location and then for the upgrade chooses a different location, should the old program be first automatically uninstalled or should the uninstall be done manually/by a separate program such as an updater or whatever.  
I ask that because when I tried doing that very scenario the old version was not automatically uninstalled and the new version was simply installed at the new location.
 
Does that mean when we install a newer version it simply overwrites the old version giving the appearance that the old version was uninstalled prior to the new installation when in fact it was not?

Randem

Check the Inno Setup help documentation for other functions, syntax etc...

spick56

Thanks a lot for that, works great. Just one more question.  
 
What other functions are available in the [Code] section. What language/syntax is used?

Randem

Sorry doing to many things at once here... The entry would be used like so in your registry line
 
ValueData: GetVersion();
 
As far as checking to see what is already installed you can check the registry key like so. Of course change the name of InnoScript to the name of your application.
 
// Indicates whether InnoScript is installed.
   
function InitializeSetup(): Boolean;
var
    success: boolean;
    sStr: String;
begin
    success := RegQueryStringValue(HKLM, 'SOFTWAREMicrosoftWindowsCurrentVersionUninstallInnoScript_is1', 'DisplayName', sStr);
    Result := True;
    if sStr  'InnoScript' then
       begin
          MsgBox('InnoScript not installed, Cannot install update.', mbInformation, MB_OK)
          Result := False
       end;
end;

spick56

I do have a separate utility that initiates the installation and I was just having problems determining whether the installation had been successful. I thought that perhaps as part of standard installation there would be some registry entry that I could check for the current version of the application being installed but looks like I would need to add a registry entry such as the one suggested so thanks for confirming that.
 
As for the second part of your response, I'm not sure what you mean. Are you saying that I can add a [Code] section to my InnoScript template with the GetVersion() function that I could then call like so {GetVersion} from my registry line.
 
Sorry for my ignorance.

Randem

The best way to do what you want is to write a separate application to check for correct installation. It can be rather complicated to do it in the script but it can be done.
 
To get the {AppVersion} in the script the way you want you will need to write code that you can call from that location to return the {AppVersion}. The code in the code section would basically be
 
function GetVersion(): String;
begin
  Result:=ExpandConstant({AppVersion})
end;

spick56

In experimenting with registry, I included the following entry in my template:
 
[Registry]
Root: HKLM; Subkey: SoftwareClassesInstallerAssembliesC:|Program Files|My Company Name|My Product Name|My Product Name.exe; ValueType: string; ValueName: Version; ValueData: {AppVersion}; Flags: uninsdeletevalue
 
The above entry gave me an error in that it couldn't interpret {AppVersion} and if I use the following entry then it works:
 
Root: HKLM; Subkey: SoftwareClassesInstallerAssembliesC:|Program Files|My Company Name|My Product Name|My Product Name.exe; ValueType: string; ValueName: Version; ValueData: 1.0.123 ; Flags: uninsdeletevalue
 
Is there a way of automating that step or do I always have to manually insert the appropriate version number in my script and again, is this the approach I should take or is there a better way of determining the version of my installed application?

spick56

Hi,
 
When I install my VB6 application I would like my 'Updater' utility to verify that the installation went OK and to do that I'd like to check the registry for the version of the installed application.
If the registry version is same as the expected version than I'll assume that the installation went OK.
 
My question is would that be the right approach and if so, where in registry can I find the version of the installed application?
 
The only [Registry] info that I can find in InnoSetup is as per below:
 
Any advice would be most welcome.
 
/Mike
 
 
[Registry]
Root: HKCU; Subkey: SoftwareMicrosoftWindows NTCurrentVersionAppCompatFlagsLayers; ValueType: string; ValueName: {app}MyApp.exe; ValueData: RUNASADMIN; Flags: uninsdeletevalue  
Root: HKLM; Subkey: SoftwareMicrosoftWindows NTCurrentVersionAppCompatFlagsLayers; ValueType: string; ValueName: {app}MyApp.exe; ValueData: WINXPSP2; Flags: uninsdeletevalue  
;
Root: HKCR; SubKey: .gemr; ValueType: string; ValueData: MyApp.Document; Flags: uninsdeletekey; Tasks: Association1
Root: HKCR; SubKey: MyApp.Document; ValueType: string; ValueData: MyApp Document; Flags: uninsdeletekey; Tasks: Association1
Root: HKCR; SubKey: MyApp.DocumentShellOpenCommand; ValueType: string; ValueData: {app}MyApp.exe %1, open; Flags: uninsdeletevalue; Tasks: Association1
Root: HKCR; Subkey: MyApp.DocumentDefaultIcon; ValueType: string; ValueData: {app}MyApp.exe, -1; Flags: uninsdeletevalue; Tasks: Association1