Re: No touch deployment

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: ALI-R (newbie_at_microsoft.com)
Date: 11/30/04


Date: Mon, 29 Nov 2004 16:05:01 -0800

You'd better make a batch file like the one below and ask users to run it
before running your application.this is what most of the us do for now.

@rem - polchgprompt - Enables or disables the prompt that is displayed
@rem whenever Caspol.exe is run using an option that would cause policy
changes.
@rem - machine - specifies adding the new code group at machine policy
level.
@rem - addgroup - Adds a new code group to the code group hierarchy
@rem - url - Specifies code that originates from the given URL.
@rem - n - specifies the scripting name for a code group to add.

CD %windir%\microsoft.net\framework\v1.1.4322

caspol.exe -polchgprompt off -machine -addgroup All_Code -url
http://yourserver/yourapp/* FullTrust -n MagNetAlertVanSps02
caspol.exe -polchgprompt on
Pause

I will keep monitoring this thread,let me know if you need more help
Hope this helps.
Reza Alirezaei

"Steve Bugden" <SteveBugden@discussions.microsoft.com> wrote in message
news:4CB88BAB-72F6-42B8-AA5C-F28F0EA57FDA@microsoft.com...
> Hi,
>
> I have deployed a .net application of across the web, using standard code
> (attached). THis works except that I have to give trust to the 7 dlls in
my
> application individually using the .Net Framework 'trust an assembly'
wizard.
> I can't expect my users to do that.
>
> Firstly, I would like to be able to present the user with a messagebox in
> which he clicks OK to trust my assemblies.
>
> As a second step, I would like to be able to detect for the presence of
the
> .Net Framework and allow the user to install it.
>
> Can anyone please point me to a good resource which would explain what I
> want to do. I just have't managed to find anything that really explains it
> well.
>
> Many Thanks,
>
> Steve Bugden
>
> Imports System.Reflection
>
> Public Class Form1
> Inherits System.Windows.Forms.Form
>
> Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
>
> Try
>
> strmsg = "http://someurlname/somedllname.dll"
>
>
> 'Register an event to determine the assembly, if not found ie when
using
> deep serialisation
>
> Dim currentdomain As AppDomain = AppDomain.CurrentDomain
>
> 'Event to catch error during deep serialisation
> AddHandler currentdomain.assemblyresolve, AddressOf
MyResolveEventHandler
>
> Dim strFormTOLoad As String
> strFormTOLoad = "Appname.MainFormName"
>
> Dim objStartAssenbly As [Assembly] = [Assembly].LoadFrom(strMsg)
>
> Dim FormType As Type = objStartAssenbly.GetType(strFormTOLoad)
>
> Dim objStartForm As Object
>
> objStartForm = Activator.CreateInstance(FormType)
>
> Dim form2 As Form = CType(objStartForm, Form)
> Me.Hide()
> form2.ShowDialog()
> Application.Exit()
>
> Catch ex As Exception
>
> MsgBox(ex.Message & ControlChars.CrLf & ControlChars.CrLf &
> ex.StackTrace)
> End Try
> End Sub
>
> Private Shared Function MyResolveEventHandler(ByVal sender As Object,
ByVal
> args As ResolveEventArgs) As [Assembly]
>
> 'Get a list of all the assemblies loaded in our appdomain
> Dim assemblies() As [Assembly] = AppDomain.CurrentDomain.GetAssemblies
>
> 'Search the list to find the assembly that was not found
> Dim asm As [Assembly]
>
> For Each asm In assemblies
> If asm.FullName = args.Name Then
> Return asm
> End If
> Next
> End Function
>
> End Class



Relevant Pages

  • Re: Can RCW and CCW be used together?
    ... component project reference to my client project and build. ... Dim iads As IadsAutomationLib.Application ... problem-domain specific assemblies and the assemblies for the RCW-Interop ...
    (microsoft.public.dotnet.framework.interop)
  • Re: Eval code and AppDomains
    ... Crossing app domains and generating these assemblies ... > I needed a way to Eval this string and return a Boolean result. ... > Dim objEval As New EvalProvider ... > sb.Append("Imports System.Data" & vbCrLf) ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Eval code and AppDomains
    ... Do you know of any other way to Eval a String to get a Boolean result other ... >> Dim objEval As New EvalProvider ... >> Imports Microsoft.VisualBasic ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: security/strong name/zones clarification needed
    ... Dim zz As New System.Security.PermissionSet ... >> When assemblies are ... >>>needs to host the CLR, it creates an AppDomain, but due ... >>>will recieve the permission grant you expect (in this ...
    (microsoft.public.dotnet.security)
  • Re: Eval code and AppDomains
    ... Do you know of any other way to Eval a String to get a Boolean result ... Rick Strahl's article showed how to create a separate appdomain. ... > Based on how other assemblies work with an AppDomain that is correct. ... >> Dim objEval As New EvalProvider ...
    (microsoft.public.dotnet.framework.aspnet)