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

Installer does not give error when it is not able to create services

Hi All,

If an user run the installer without administrator permissions, the installer is going to create all folder but it's not going to be able to create the services. The installation is completed successfully when it should be give an error.

Regards,
Sreekanth
Labels (1)
0 Kudos

(6) Replies
srik_008
Level 7

Can anybody help me to work this issue
0 Kudos
pv7721
Level 20

I think you should check the user running the installer, and abort the installation if the user's not an administrator!
0 Kudos
srik_008
Level 7

pv7721 wrote:
I think you should check the user running the installer, and abort the installation if the user's not an administrator!


Thank you for Reply then how to give proper warning message if user doesn't have admin privileges.

without proper warning message the installer is going to create all folder but it's not going to be able to create the services. The installation is completed successfully when it should be give an error.
0 Kudos
pv7721
Level 20

On what platform do you need that?
0 Kudos
srik_008
Level 7

pv7721 wrote:
On what platform do you need that?


windows 2008 r2
0 Kudos
pv7721
Level 20

I would say something like that...

[CODE]package ;

import com.zerog.ia.api.pub.*;
import com.installshield.wizard.service.security.*;
import com.installshield.wizard.service.ServiceException;

public class CheckIfUserHasAdministrativeRights extends CustomCodeAction {

public void install( InstallerProxy installerProxy ) throws InstallException {

SecurityService ss = (SecurityService) installerProxy.getService(SecurityService.class);

try
{
if (ss.isCurrentUserAdmin())
{//The user installing the designer has administrative rights
installerProxy.setVariable( "USER_HAS_ADMINISTRATIVE_RIGHTS", "true" );
}
else
{
installerProxy.setVariable( "USER_HAS_ADMINISTRATIVE_RIGHTS", "false" );
}
} catch (ServiceException e) {//Do nothing...
}
return;
}

public void uninstall( UninstallerProxy uninstallerProxy ) throws InstallException {
}

public String getInstallStatusMessage() {
return null;
}

public String getUninstallStatusMessage() {
return null;
}


public static void main( String[] strings ) {

}
}
[/CODE]
0 Kudos