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

Version find


9 replies to this topic

kirankumar

kirankumar
  • Full Members
  • 29 posts

Posted 02 April 2008 - 13:22

Hi All,

I have problem with finding the version, by using below code i write IS custom action while running this code in first sprintfbox i got one negative value, reason i got in net for negative is

"< ISERR_SUCCESS The function failed to retrieve the installed version information; the registry key or value does not exist or the data is not a packed DWORD."

but Actual scenario of registry i send as attachment.

This is the code what i was used

nResult11=VerProductGetInstalledVersion ( svVersionInstalled );

if (nResult11 >= ISERR_SUCCESS) then
SprintfBox ( INFORMATION,"IF","%ld",nResult11);
elseif (nResult11 < ISERR_SUCCESS) then
SprintfBox ( INFORMATION,"ELSEIFld","%ld",svVersionInstalled);
SprintfBox ( INFORMATION,"ELSEIFs","%s",svVersionInstalled);
else
SprintfBox ( INFORMATION,"ELSE","%ld",nResult11);
endif;

Please send the proper suggestion for finding the product version of application, i know how to get from file , but i want from reg entry, please help me i am in little bit urgency...........Thanks for your great suggestions.

Attached Images

  • reg_uninstall.JPG

Edited by kirankumar, 02 April 2008 - 13:24.


VBScab

VBScab
  • Full Members
  • 436 posts

Posted 02 April 2008 - 16:33

Use the Windows.Installer automation object instead. It will be much simpler, with the additional bonus of there being copious documentation on how to use it.
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

kirankumar

kirankumar
  • Full Members
  • 29 posts

Posted 03 April 2008 - 09:49

Thanks You for ur reply, but that is useful in programing how to use that in custom action?,please suggest me if any other method instead of this, and i is there any wrong with my example what i mention in earlier..

Edited by kirankumar, 03 April 2008 - 09:50.


VBScab

VBScab
  • Full Members
  • 436 posts

Posted 03 April 2008 - 09:57

Tell us EXACTLY what it is you are trying to do. For example, are you trying to find the version number of a product which is already installed?
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

kirankumar

kirankumar
  • Full Members
  • 29 posts

Posted 03 April 2008 - 11:20

Thanks for Reply, Exactly i am trying to find the version number of a product which is already installed through the install shield.

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 03 April 2008 - 11:42

So, you know its ProductCode?
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

kirankumar

kirankumar
  • Full Members
  • 29 posts

Posted 03 April 2008 - 12:02

Yes, i know the product code of my product.

Edited by kirankumar, 03 April 2008 - 12:02.


VBScab

VBScab
  • Full Members
  • 436 posts

Posted 03 April 2008 - 12:31

OK, here's some code to get you started. You'll need to add error-trapping and a test for your ProductCode:

CODE

Set objInstaller = CreateObject("WindowsInstaller.Installer")

Set colProducts = objInstaller.Products
For Each objProduct In colProducts
strVersion  = DecodeVersion(objInstaller.ProductInfo(objProduct, "Version"))
strInfo  = "Product with Product Code " & objProduct & " is " & objInstaller.ProductInfo(objProduct, "ProductName") & ", version " & strVersion

WScript.Echo strInfo
Next

Function DecodeVersion(version)
version = CLng(version)
DecodeVersion = version\65536\256 & "." & (version\65535 MOD 256) & "." & (version Mod 65536)
End Function



There's a nice WI script and class here.

Edited by VBScab, 03 April 2008 - 12:32.

- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

kirankumar

kirankumar
  • Full Members
  • 29 posts

Posted 03 April 2008 - 13:36

Thanks very much VBscab, i got the version number.

I have one more problem please give one good suggestion

Problem: i wrote one module in vc++ for Auto update, what it will do is when ever your running the application in client machine it will check server for new versions if it is available it will down load and it will install in the client machine,

up to here its working fine, last week we uploaded new version of soft ware to the server,

in client machine it was downloaded and updated the all dll's, but it didn't updated the product version,

After that we created one patch through installer and sent to client and we made to work for only latest version, but it is not working for the latest one,

problem is all files are updated to new version and product was not updated to new one,
so it is checking the product version and it was telling that it is for only new version it will not work for old version and exiting from installer patch,

now we need to change the product version, i changed manually in registry HKLM\softwares\microsoft\current version\uninstall\{product code},

After changed still it is giving problem as it is applicable to only new version and termenating the application.

for this scenario please give me some suggestions, how my patch will work for latest update.......



VBScab

VBScab
  • Full Members
  • 436 posts

Posted 03 April 2008 - 14:14

QUOTE (kirankumar @ 2008-04-03 12:36)
now we need to change the product version, i changed manually in registry HKLM\softwares\microsoft\current version\uninstall\{product code}

Hacks like that (changing the Product Code in the registry) seldom work.

All I can suggest is that you run the install with a verbose log. That will show you what 'decisions' Windows Installer made during the installation process. Anything else is pure guesswork.
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.