Solved

InstallShield: Register Keys

Posted on 1998-04-21
2
886 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 120 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
Problem to packaging 1 127
Build VS2015 project in bat command 3 106
VS2015 Redefinition errors 4 102
VIDEO DATASOURCE Control Resize issue 2 62
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
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…

734 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