Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

InstallShield: Register Keys

Posted on 1998-04-21
2
Medium Priority
?
908 Views
Last Modified: 2013-12-03
Why does function RegDBCreateKeyEx not work after calling SDRegisterUserEx (InstallShield 5.0)? What do I have to do to write to Registry after that?
0
Comment
Question by:Heinig
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
ljadams earned 360 total points
ID: 1298848
I tried this and RegDBCreateKeyEx works fine after calling SdRegisterUserEx.  (Of course, I had some compile errors until I made the 'D' lowercase in "SdRegisterUserEx.)  Did you call RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE) before you call RegDBCreateKeyEx? The default path that your key will be created is under HKEY_CLASSES_ROOT.
Here's a sample of what I did:

declare
 #include "Sddialog.h"
 #define PRODUCT_NAME            "MyApp"
 #define PRODUCT_VERSION         "1.0"
 #define DEINSTALL_KEY           "MyDeinstallKey"
 #define UNINSTALL_NAME          "MyApp"
 #define PRODUCT_KEY             "appName.exe"
 #define MYAPP_PATH              "MyCompany\\MyAppDir\\"


 STRING  svTarget, svUninstLogFile, szMsg, svName;
 STRING  svCompany, svSerial, szKey, szClass;

program
start:
  Disable( BACKGROUND );
  szMsg = "Enter your information:";
  SdRegisterUserEx( "Register", szMsg, svName, svCompany, svSerial );
  // You could also hardcode the path below if you want.
  // szKey = "SOFTWARE\\YourCompany\\TheKeyYouWantToCreate";
  szKey = "SOFTWARE" ^ svCompany ^ UNINSTALL_NAME;
  szClass = "";
  RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
  RegDBCreateKeyEx(szKey, szClass);
  InstallationInfo( svCompany, PRODUCT_NAME, PRODUCT_VERSION, PRODUCT_KEY );
  svTarget = PROGRAMFILES ^ MYAPP_PATH;
  DeinstallStart( svTarget, svUninstLogFile, DEINSTALL_KEY, 0 );
  RegDBSetItem( REGDB_UNINSTALL_NAME, UNINSTALL_NAME );

// Rest of your Setup.

  exit;

 #include "Sddialog.rul"


If this does not work, I would have to see more of your code to see what you are doing.  Does your code compile okay?  Does the SdRegisterUserEx dialog appear with your default user name and company name?  You could also be having trouble if the key you are using for RegDBCreateKeyEx already exists or conflicts with the key created by DeinstallStart.

Good Luck!
L. Jay

Note: All the information above represents my own opinions and my own knowlege based on my limited experience, and does not in any way reflect those of Intel Corp.
0
 

Author Comment

by:Heinig
ID: 1298849
Wondering why I should set the default path (should have been set already by system), I found out that this is a bug in Installshield. Works okay with Build 219 or higher. But till the patch arrives, ljadams workaround works great.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question