Sorry if I sound ignorant.... I'm brand new to this stuff... What do I do with this section of code when created by the wizard?
///////////////////////////////////////////////////////////////////////////////
// //
// Function: ProcessBeforeDataMove //
// //
// Purpose: This function performs any necessary operations prior to the //
// actual data move operation. //
// //
///////////////////////////////////////////////////////////////////////////////
function ProcessBeforeDataMove()
STRING svLogFile;
NUMBER nResult;
begin
InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY );
svLogFile = UNINST_LOGFILE_NAME;
nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 );
if (nResult < 0) then
MessageBox( @ERROR_UNINSTSETUP, WARNING );
endif;
szAppPath = TARGETDIR; // TODO : if your application .exe is in a subdir of TARGETDIR then add subdir
if ((bIs32BitSetup) && (bIsShellExplorer)) then
RegDBSetItem( REGDB_APPPATH, szAppPath );
RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY );
RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME );
endif;
// TODO : update any items you want to process before moving the data
//
return 0;
end;
For my custom program to run, I did this in SetupRegistry():
szKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MyApp2";
szName = "DisplayName";
szValue = "My AppUninstaller";
if (RegDBSetKeyValueEx(szKey, szName, REGDB_STRING, szValue, -1) < 0) then
MessageBox("Unable to set application path key.", SEVERE);
endif;
szKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MyApp 2";
szName = "UninstallString";
szValue = TARGETDIR ^ "MYUninstall.exe";
if (RegDBSetKeyValueEx(szKey, szName, REGDB_STRING, szValue, -1) < 0) then
MessageBox("Unable to set application path key.", SEVERE);
endif;
then I commented out the 1st code block:
///////////////////////////////////////////////////////////////////////////////
// //
// Function: ProcessBeforeDataMove //
// //
// Purpose: This function performs any necessary operations prior to the //
// actual data move operation. //
// //
///////////////////////////////////////////////////////////////////////////////
function ProcessBeforeDataMove()
STRING svLogFile;
NUMBER nResult;
begin
InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY );
svLogFile = UNINST_LOGFILE_NAME;
// nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 );
// if (nResult < 0) then
// MessageBox( @ERROR_UNINSTSETUP, WARNING );
// endif;
szAppPath = TARGETDIR; // TODO : if your application .exe is in a subdir of TARGETDIR then add subdir
// if ((bIs32BitSetup) && (bIsShellExplorer)) then
// RegDBSetItem( REGDB_APPPATH, szAppPath );
// RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY );
// RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME );
// endif;
// TODO : update any items you want to process before moving the data
//
return 0;
end;
Since in your method I don't need my custom program to run, I'm wondering what I need. Also, in the custom DLL, how does the UninstallShield script actually run?
Thanks a lot!