cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mumbles
Level 7

Administrative Area Custom Action help..

Hello all,

We just purchased Installshield 2010 , hoping it would have some built-in stuff to fix our problems with Win7. No dice...

I'm trying to run a custom action of type: 1089 running against Windows 7 OS. I have the RequireAdministrativePrivileges = Yes.

Basically what this installscript custom action does is, build a string and then execute.

The final string we execute is...

cmd /c "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe" "C:\Program Files\Code Red\Red Alerts\OurDll.dll"

And that's it. However, the following list will show when it works. And when it wont' work. Notice the inconsistancies on right clicking on cmd.exe and right clicking on my setup.exe. Does anyone know how to get this to work without right clicking and without running from administrative command line?

1. MSI File. Running Custom Action as Deferred System Context = FAILED.
2. MSI File. Running Custom Action as Deferred System Context, run from Cmd.exe right click (Run as administrator) = FAILED.

3. MSI File. Running Custom Action as Deferred Context = FAILED.
4. MSI File. Running Custom Action as Deferred Context, run from Cmd.exe as administrator = SUCCEEDED.

5. EXE File. Running Custom Action as Deferred System Context, Right Click Run As Admistrator = FAILED.
6. EXE File. Running Custom Action as Deferred Context, Right Click Run As Admistrator = SUCCEEDED.
Labels (1)
0 Kudos
(2) Replies
mumbles
Level 7

I read the article about running custom actions in the 'deferred system context' when dealing with Win7 and Vista. So i tried that out. No luck.

More Details:

1. I am an administrator on the machine.
2. We use AppSearch to build our strings and find the RegAsm.exe file in the .net framework folder.
2. Custom Action Table: RegisterOffice, 1089, ISSetup.dll, f2
3. Custom Action Code:

//************************* Fn_RegisterOffice **************************************** 
export prototype Fn_RegisterOffice(HWND);

function Fn_RegisterOffice(hMSI)
STRING szRegasm, szAddin, szApp, szInstallDir, szValue, szOfficePath, szOffice2003,szOffice2007 , szPath;
number nSize, nType, nResult;

begin
RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
nType = REGDB_STRING;
nSize = 256;
szOffice2007 = 'CodeRed.RedAlerts.MSOffice2007AddInX.dll"';
szOffice2003 = 'CodeRed.RedAlerts.MSOffice2003AddinVersion2.dll"';
szAddin = '/Addin=';

//1 ----Gather Registry keys to build strings and paths...
nResult = RegDBGetKeyValueEx(REGISTRYKEY, 'InstallDir', nType, szInstallDir, nSize);
nResult = RegDBGetKeyValueEx(REGISTRYKEY, 'Regasm', nType, szRegasm, nSize);
nResult = RegDBGetKeyValueEx(OFFICEKEY, 'Path', nType, szOfficePath, nSize);
nResult = RegDBGetKeyValueEx(REGISTRYKEY, 'RegisterPath', nType, szValue, nSize);

if( nResult < 0 ) then
MessageBox("Cannot Register registry key OfficeAddIn - 1", WARNING);
else

endif;

//Register 2003 Addin
szApp = szRegasm + " " + szInstallDir + szOffice2003;
nResult = LaunchAppAndWait(CMD, "/c" + szApp, LAAW_OPTION_WAIT|LAAW_OPTION_MINIMIZED);

if( nResult < 0 ) then
MessageBox("Cannot Register OfficeAddIn 2003", WARNING);
else

endif;

//Register 2007 Addin
szApp = szRegasm + " " + szInstallDir + szOffice2007;
nResult = LaunchAppAndWait(CMD, "/c" + szApp, LAAW_OPTION_WAIT|LAAW_OPTION_MINIMIZED);

if( nResult < 0 ) then
MessageBox("Cannot Register OfficeAddIn 2007", WARNING);
else

endif;

end;
0 Kudos
mumbles
Level 7

Anyone? I'm getting pretty desperate here...
0 Kudos