Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > WebLaunched Windows App
 

WebLaunched Windows App

I want to launch a windows app from an intranet web portal. I have done the following:
-Created an msi project that installs primary output from WebPermissionClassProject
-WebPermissionClassProject contains installer.vb with this:
Public Sub New()
...
        Dim machinePolicyLevel As PolicyLevel = Nothing
        Dim ph As System.Collections.IEnumerator = SecurityManager.PolicyHierarchy
        Dim pl As PolicyLevel
        Do While ph.MoveNext
            pl = CType(ph.Current, PolicyLevel)
            If pl.Label = "Machine" Then
                machinePolicyLevel = pl
                Exit Do
            End If
        Loop
        If machinePolicyLevel Is Nothing Then Return

        Dim ucg As UnionCodeGroup = New UnionCodeGroup(New UrlMembershipCondition("http://<MyActualWebServer>/*"), New PolicyStatement(New NamedPermissionSet("FullTrust")))
        ucg.Description = "WebDeploy permissions"
        ucg.Name = "CommApps"
        machinePolicyLevel.RootCodeGroup.AddChild(ucg)
        SecurityManager.SavePolicy()
    End Sub

Launching the exe on my dev machine throws an error here:

System.Security.SecurityException: Request for the permission of type System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
   at System.Security.CodeAccessSecurityEngine.CheckTokenBasedSetHelper(Boolean ignoreGrants, TokenBasedSet grants, TokenBasedSet denied, TokenBasedSet demands)
   at System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet denied, PermissionSet demands)
   at System.Security.Principal.WindowsIdentity.GetCurrent()
....

On a remote machine the exe doesn't launch or throw an error; nothing happens.

If I manually create the code group using the paramters listed above, the app to works. What am I missing?
MigrationUser 1  Friday, October 22, 2004 3:07 PM
Additionally, when I run the installer, there are no errors, but the code group does not show up in the Runtime Security Policy section of the .net config tool.
MigrationUser 1  Friday, October 22, 2004 4:22 PM
Fixed. It had to do with the setup project. The code group gets created, but the only way a user can launch the is by clicking on an icon that targets c:\...\ieexec "HTTPPathToTheExe". Clicking on the exe in a directory browse window does nothing.
MigrationUser 1  Monday, October 25, 2004 4:47 PM

You can use google to search for other answers

Custom Search

More Threads

• Smart forms vs remoting
• The referenced assembly is not installed on your system. (Exception from HRESULT: 0x800736B3)
• ClickOnce error on Crystal Reprot Engine
• J# request while installing a deployment project
• ClickOnce Manual update logic, UpdateCheckInfo.AvailableVersion returns exception on no new version
• Keep getting failed to connect with clickonce when republishing
• Unable to add files to new Project
• Setup Project in VisualStudio.NET(2003)
• Setup project: install Windows Service with new user fails with "No mapping between account names and security IDs was done"
• ClickOnce deployment with side-by-side com components