This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- Is it possible to get the final output as .msi file, instead of .exe format.?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 29, 2013
08:33 AM
SecurityService class not found
Hi,
I am trying to check for admin rights in my installer. I used the code
import com.zerog.ia.api.pub.CustomCodeRule;
import com.installshield.wizard.service.security.*;
public class AdminRule extends CustomCodeRule {
public boolean evaluateRule() {
SecurityService service = (SecurityService)
ruleProxy.getService(SecurityService.class);
boolean isAdmin = false;
try{
isAdmin = service.isCurrentUserAdmin();
}catch(Throwable e){}
return isAdmin;
}
}
But the above code gave me 'com.installshield.wizard.service.security.SecurityService class not found' error. I tried using InstallerProxy as advisedin the help manual.(Calling Installshield MultiPlatform APIs in Install Anywhere).
public class AdminRule extends CustomCodeRule {
public boolean evaluateRule() {
InstallerProxy ip;
SecurityService service = (SecurityService)
ip.getService(SecurityService.class);
boolean isAdmin = false;
try{
isAdmin = service.isCurrentUserAdmin();
}catch(Throwable e){}
return isAdmin;
}
}
But still getting the error in Service class.
Thanks in advance
Regards,
Vidya
I am trying to check for admin rights in my installer. I used the code
import com.zerog.ia.api.pub.CustomCodeRule;
import com.installshield.wizard.service.security.*;
public class AdminRule extends CustomCodeRule {
public boolean evaluateRule() {
SecurityService service = (SecurityService)
ruleProxy.getService(SecurityService.class);
boolean isAdmin = false;
try{
isAdmin = service.isCurrentUserAdmin();
}catch(Throwable e){}
return isAdmin;
}
}
But the above code gave me 'com.installshield.wizard.service.security.SecurityService class not found' error. I tried using InstallerProxy as advisedin the help manual.(Calling Installshield MultiPlatform APIs in Install Anywhere).
public class AdminRule extends CustomCodeRule {
public boolean evaluateRule() {
InstallerProxy ip;
SecurityService service = (SecurityService)
ip.getService(SecurityService.class);
boolean isAdmin = false;
try{
isAdmin = service.isCurrentUserAdmin();
}catch(Throwable e){}
return isAdmin;
}
}
But still getting the error in Service class.
Thanks in advance
Regards,
Vidya
9 Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 04, 2013
01:17 PM
Vidya,
I think you need to add:
I think you need to add:
import static com.zerog.ia.api.pub.CustomCodeRule.ruleProxy;
Vidyasree wrote:
Hi,
I am trying to check for admin rights in my installer. I used the code
import com.zerog.ia.api.pub.CustomCodeRule;
import com.installshield.wizard.service.security.*;
public class AdminRule extends CustomCodeRule {
public boolean evaluateRule() {
SecurityService service = (SecurityService)
ruleProxy.getService(SecurityService.class);
boolean isAdmin = false;
try{
isAdmin = service.isCurrentUserAdmin();
}catch(Throwable e){}
return isAdmin;
}
}
But the above code gave me 'com.installshield.wizard.service.security.SecurityService class not found' error. I tried using InstallerProxy as advisedin the help manual.(Calling Installshield MultiPlatform APIs in Install Anywhere).
public class AdminRule extends CustomCodeRule {
public boolean evaluateRule() {
InstallerProxy ip;
SecurityService service = (SecurityService)
ip.getService(SecurityService.class);
boolean isAdmin = false;
try{
isAdmin = service.isCurrentUserAdmin();
}catch(Throwable e){}
return isAdmin;
}
}
But still getting the error in Service class.
Thanks in advance
Regards,
Vidya
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 04, 2013
02:38 PM
In addition to the import static com.zerog.ia.api.pub.CustomCodeRule.ruleProxy, you need to configure the following jarfiles as dependencies of your class :
[LIST=1]
path\to\root\of\InstallAnywhereInstallation\resource\services\services.jar
path\to\root\of\InstallAnywhereInstallation\resource\services\ppk\windowsppk.jar
With that, it works in my code. Thanx for the tip.
--
Sandy
[LIST=1]
With that, it works in my code. Thanx for the tip.
--
Sandy
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 04, 2013
02:55 PM
Now,
I have another question. In my CustomCodeRule class, I want to test from Netbeans which easier than building an installer everytime I change something. So I have:
I get an exception at this line in my checkAdmin() method:
I presume there is some sort of setup that InstallAnywhere does. Is that something I can mimic outside of it. Being able to test these classes outside of IA would speed my development time up greatly.
--
Sandy
I have another question. In my CustomCodeRule class, I want to test from Netbeans which easier than building an installer everytime I change something. So I have:
public static void main( String[] args ) {
MyCustomCodeRule test_ccr = new MyCustomCodeRule();
test_ccr.evaluateRule();
}
I get an exception at this line in my checkAdmin() method:
SecurityService sservice = (SecurityService) ruleProxy.getService( SecurityService.class);
I presume there is some sort of setup that InstallAnywhere does. Is that something I can mimic outside of it. Being able to test these classes outside of IA would speed my development time up greatly.
--
Sandy
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 26, 2013
08:08 AM
Hi Sandy,
May i know the steps u followed to make it working?
I tried in eclipse and i have tried the two steps mentioned by you. but still the issue remains.:(
May i know the steps u followed to make it working?
I tried in eclipse and i have tried the two steps mentioned by you. but still the issue remains.:(
scarney wrote:
In addition to the import static com.zerog.ia.api.pub.CustomCodeRule.ruleProxy, you need to configure the following jarfiles as dependencies of your class :
[LIST=1]path\to\root\of\InstallAnywhereInstallation\resource\services\services.jar path\to\root\of\InstallAnywhereInstallation\resource\services\ppk\windowsppk.jar
With that, it works in my code. Thanx for the tip.
--
Sandy
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 04, 2013
06:46 PM
Vidya,
In your java code, you also need to do import com.installshield.wizard.service.security.SecurityService;
--
Sandy
In your java code, you also need to do import com.installshield.wizard.service.security.SecurityService;
--
Sandy
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 16, 2013
06:31 AM
Hi Sandy,
I doubt my way of doing is wrong.
Could you please tell me in steps for adding Execute custom code for checking admin rights?
Regards,
Vidhya
I doubt my way of doing is wrong.
Could you please tell me in steps for adding Execute custom code for checking admin rights?
Regards,
Vidhya
scarney wrote:
Vidya,
In your java code, you also need to do import com.installshield.wizard.service.security.SecurityService;
--
Sandy
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 17, 2013
11:46 PM
Hi Vidya,
Try this-
- Create a jar
- In the project file,add this in your custom rule
- Add dependency services.jar from $IA_HOME$\resource\services\services.jar
- Under Project > JVM Settings, enable checkbox 'Add service support for custom code'
Let me know if this works.
Thanks,
Ramya
Try this-
import com.installshield.wizard.service.security.SecurityService;
import com.zerog.ia.api.pub.CustomCodeRule;
public class AdminRule extends CustomCodeRule {
public boolean evaluateRule() {
CustomCodeRule.setCustomCodeRuleProxy(ruleProxy);
SecurityService service = (SecurityService) ruleProxy
.getService(SecurityService.class);
boolean isAdmin = false;
try {
isAdmin = service.isCurrentUserAdmin();
} catch (Throwable e) {
}
return isAdmin;
}
}
- Create a jar
- In the project file,add this in your custom rule
- Add dependency services.jar from $IA_HOME$\resource\services\services.jar
- Under Project > JVM Settings, enable checkbox 'Add service support for custom code'
Let me know if this works.
Thanks,
Ramya
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 28, 2014
12:39 AM
Is it possible to get the final output as .msi file, instead of .exe format in InstallAnyWhere ?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 04, 2014
03:00 AM
AFAIK this is not possible, as IA is multi platform, whereas .msi is Windows specific.
