Installer un logiciel sans les droits administrateur
cs_Tatar
Messages postés46Date d'inscriptionmardi 30 avril 2002StatutMembreDernière intervention17 février 2003
-
7 mai 2002 à 12:21
daetips
Messages postés142Date d'inscriptionjeudi 10 juillet 2003StatutMembreDernière intervention10 novembre 2007
-
13 juin 2005 à 14:52
Bonjour a tous !!
J'ai développer une appli en VB avec une liaison ODBC vers une base access.
Je voudrais installer cette appli sur des postes qui n'ont pas le droit administrateur. Comment puis-je faire ?
cs_chewbacca
Messages postés4Date d'inscriptionmercredi 8 mai 2002StatutMembreDernière intervention 8 mai 2002 8 mai 2002 à 11:35
Salut,
J'ai rencontré le meme probleme, la seule solution qui aie fonctionné etait de :
1°) créer le setup de distribution a l'aide d'une application du style Wise installer.
(si les restrictions ne sont pas trop elevées ca peux fonctionner alors que le setup créé par VB ne fonctionne pas)
2°) si ta boite dispose d'un logiciel de type HPDTA qui permet les installations a distance, créer un JOB qui lance l'installation de ce setup. En effet ce type d'application execute les installation en lancant un service qui lui se connecte sur la machine en utilisant un autre account que celui de l'utilisateur.
cs_bastogne
Messages postés5Date d'inscriptionmercredi 24 mars 2004StatutMembreDernière intervention 8 novembre 2005 10 déc. 2004 à 16:03
J'ai rencontré le meme problème et en cherchant sur le site j'ai trouvé des "pièces détachées" pour réaliser le programme d'installation désinstallation et mise à jour qui suis. Avec ce programme j'arrive à installer les Dll sans problèmes en ayant pas les droits administrateur il me reste juste un problème avec le composant activeX (mscomctl.ocx)
NB: j'arrive à installer tout sans prob quand j'ai "les droit d'utilisateur avec pouvoir" alors que normalement je ne peux pas installer de programme
Didier
NB: les ordis sur lesquel j'ai testé ce prog sont tous équipés de WinXPpro ce ne sera pas nécessairement efficace pour un ordi qous WinNT
Const CSIDL_DESKTOP = &H0
Const CSIDL_PROGRAMS = &H2
Const CSIDL_CONTROLS = &H3
Const CSIDL_PRINTERS = &H4
Const CSIDL_PERSONAL = &H5
Const CSIDL_FAVORITES = &H6
Const CSIDL_STARTUP = &H7
Const CSIDL_RECENT = &H8
Const CSIDL_SENDTO = &H9
Const CSIDL_BITBUCKET = &HA
Const CSIDL_STARTMENU = &HB
Const CSIDL_DESKTOPDIRECTORY = &H10
Const CSIDL_DRIVES = &H11
Const CSIDL_NETWORK = &H12
Const CSIDL_NETHOOD = &H13
Const CSIDL_FONTS = &H14
Const CSIDL_TEMPLATES = &H15
Const MAX_PATH = 260
Private Type SHITEMID
cb As Long
abID As Byte
End Type
Private Type ITEMIDLIST
mkid As SHITEMID
End Type
Private Declare Function ShellAbout Lib "shell32.dll" Alias "ShellAboutA" ( _
ByVal hWnd As Long, _
ByVal szApp As String, _
ByVal szOtherStuff As String, _
ByVal hIcon As Long) As Long
Private Declare Function SHGetSpecialFolderLocation Lib "shell32.dll" ( _
ByVal hwndOwner As Long, _
ByVal nFolder As Long, _
pidl As ITEMIDLIST) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32.dll" _
Alias "SHGetPathFromIDListA" ( _
ByVal pidl As Long, _
ByVal pszPath As String) As Long
Private Declare Function fCreateShellLink Lib "STKIT432.DLL" (ByVal _
lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal _
lpstrLinkPath As String, ByVal lpstrLinkArgs As String) As Long
Dim direct As String
Dim chemin As String
'édition du registre
Const STR_COMBOBOX = "SOFTWARE\NetSend\Combobox"
Const STR_LISTS = "SOFTWARE\NetSend\Lists"
Const STR_NETSEND = "SOFTWARE\NetSend"
Const HKEY_CURRENT_USER = &H80000001
Private Declare Function RegDeleteKey Lib "advapi32.dll" Alias "RegDeleteKeyA" ( _
ByVal hKey As Long, _
ByVal lpSubKey As String) As Long
Private Function GetSpecialfolder(CSIDL As Long) As String
Dim r As Long
Dim IDL As ITEMIDLIST
'Get the special folder
r = SHGetSpecialFolderLocation(100, CSIDL, IDL)
If r = NOERROR Then
'Create a buffer
Path$ = Space$(512)
'Get the path from the IDList
r = SHGetPathFromIDList(ByVal IDL.mkid.cb, ByVal Path$)
'Remove the unnecessary chr$(0)'s
GetSpecialfolder = Left$(Path, InStr(Path, Chr$(0)) - 1)
Exit Function
End If
GetSpecialfolder = ""
End Function
Private Sub Form_Load()
chemin = "C:\Program Files\NetSend"
direct = "\\Didier\partage\programmes Home Made\Net send Package (Ultime)"
On Error Resume Next
debutinst = MsgBox("Ce script va copier les fichiers dans le repetoire C:\Program Files\NetSend\ de votre ordinateur." & vbCrLf & "Voulez vous changer le répertoire de destination ?", vbYesNo + vbQuestion, "Choix du repetoire d'installation !")
If debutinst = vbYes Then
'Une boite de dialogue s'ouvre et vous demande le chemin ou vous voulez copier les fichiers
chemin = InputBox("Rentrer ici le Chemin ou vous voulez copier les fichiers.", "Change path", "C:\Program Files\NetSend")
If Right(chemin, 1) <> "" Then chemin = chemin & ""
Else
'Sinon On copie les fichier dans le repertoire par default
chemin = "C:\Program Files\NetSend"
End If
Set ddr = CreateObject("Scripting.FileSystemObject")
If ddr.FolderExists(chemin) Then
msg = MsgBox("le programme netsend est manifestement déjà installé." & vbCrLf & vbCrLf & "Si vous voulez réparer ou remettre à jour, cliquez sur oui" & vbCrLf & vbCrLf & "si vous voulez desinstaller NetSend, cliquez sur Non", vbYesNoCancel)
If msg = vbYes Then
'réinstallation
Set fso = ddr.GetFile(chemin & "NetSend Ultime.exe")
currentversion = fso.DateLastModified
Set fso = ddr.GetFile(direct & "NetSend Ultime.exe")
newversion = fso.DateLastModified
msg = MsgBox("Vous voulez remplacer une version datée de " & currentversion & vbCrLf & "par une version datée du :" & newversion & vbCrLf & vbCrLf & "Voulez vous continuer?", vbYesNo, "Version")
If msg = vbYes Then installation True
ElseIf msg = vbCancel Then
'annulation
ElseIf msg = vbNo Then
'désinstallation
desinstallation
End If
Else
Set re = ddr.CreateFolder(chemin)
installation False
End If
Unload Form1
End Sub
Private Sub desinstallation()
Install = MsgBox("Bienvenue !" & vbCrLf & "Ce script va vous permettre de désinstaller le logiciel NetSend Ultime. Voulez vous continuer ?", vbQuestion + vbYesNo, "déinstallation du logiciel NetSend Ultime")
If Install = vbYes Then
On Error Resume Next
'on efface toutes les données enregistrées dans le registre
RegDeleteKey HKEY_CURRENT_USER, STR_COMBOBOX
RegDeleteKey HKEY_CURRENT_USER, STR_LISTS
RegDeleteKey HKEY_CURRENT_USER, STR_NETSEND
'on desinstalle les dll
Set repsys = ddr.GetSpecialfolder(1)
Dim Dllname(1 To 9)
Dllname(0) = "VB6STKIT.DLL"
Dllname(1) = "COMCAT.DLL"
Dllname(2) = "VB6FR.DLL"
Dllname(3) = "stdole2.tlb"
Dllname(4) = "asycfilt.dll"
Dllname(5) = "olepro32.dll"
Dllname(6) = "oleaut32.dll"
Dllname(7) = "msvbvm60.dll"
Dllname(8) = "MSCMCFR.DLL"
Dllname(9) = "Mscomctl.ocx"
For n = 0 To 9
ddr.CopyFile direct & Dllname(n), chemin & Dllname(n)
Path = repsys & "regsvr32.exe /u /s " & chemin & Dllname(n)
Shell Path, vbMaximizedFocus
Next
'On delete le dossier NetSend dans Programs du menu démarrer
prog = GetSpecialfolder(CSIDL_PROGRAMS) & "\NetSend"
Kill (prog & "\*.*")
RmDir (prog)
'on delete le raccourci du bureau
bureau = GetSpecialfolder(CSIDL_DESKTOP)
Kill (bureau & "\NetSend Ultime.lnk")
'on delete le raccourci dans la barre quick launch
UserProfile = GetSpecialfolder(CSIDL_STARTMENU)
UserProfile = Left(UserProfile, InStrRev(UserProfile, "")) & "Application Data\Microsoft\Internet Explorer\Quick Launch"
QuickLaunchPath = UserProfile
Kill (QuickLaunchPath & "\NetSend Ultime.lnk")
End If
End Sub
Private Sub installation(update As Boolean)
Rem --Affiche le fichier Read Me
Set FSys = CreateObject("Scripting.FileSystemObject")
Set MonFic = FSys.OpenTextFile(direct & "lisez moi avant l'installation.txt", 1)
Contenu = MonFic.ReadAll
readme = MsgBox(Contenu, vbInformation, "Lisez Moi")
Install = MsgBox("Bienvenue !" & vbCrLf & "Ce script va vous permettre d'installer le logiciel NetSend Ultime. Voulez vous continuer ?", vbQuestion + vbYesNo, "Installation du logiciel NetSend Ultime")
If Install = vbYes Then
On Error Resume Next
'On cree le dossier NetSend dans Program Files
Set ddr = CreateObject("Scripting.FileSystemObject")
Set re = ddr.CreateFolder(chemin)
'On copie netSend Ultime.exe et ses dépendances dans le dossier NetSend
ddr.CopyFile direct & "NetSend Ultime.exe", chemin & "NetSend Ultime.exe", True
ddr.CopyFile direct & "NetSend Ultime.lnk", chemin & "NetSend Ultime.lnk", True
ddr.CopyFile direct & "Install-Update-Uninstall.lnk", chemin & "Install-Update-Uninstall.lnk", True
Set repsys = ddr.GetSpecialfolder(1)
Dim Dllname(1 To 9)
Dllname(0) = "VB6STKIT.DLL"
Dllname(1) = "COMCAT.DLL"
Dllname(2) = "VB6FR.DLL"
Dllname(3) = "stdole2.tlb"
Dllname(4) = "asycfilt.dll"
Dllname(5) = "olepro32.dll"
Dllname(6) = "oleaut32.dll"
Dllname(7) = "msvbvm60.dll"
Dllname(8) = "MSCMCFR.DLL"
Dllname(9) = "Mscomctl.ocx"
'on enregistre les dll 'vbsI " Set WshShell WScript.CreateObject(" & Chr(34) & "WScript.Shell" & Chr(34) & ")" & vbCrLf 'vbsU " Set WshShell WScript.CreateObject(" & Chr(34) & "WScript.Shell" & Chr(34) & ")" & vbCrLf
For n = 0 To 9
ddr.CopyFile direct & Dllname(n), chemin & Dllname(n)
Path = repsys & "regsvr32.exe /s " & chemin & Dllname(n)
Shell Path, vbMaximizedFocus
'vbsI = vbsI & " WshShell.run (" & Chr(34) & repsys & "\regsvr32.exe /s " & chemin & Dllname(n) & Chr(34) & ")" & vbCrLf
'vbsU = vbsU & " WshShell.run (" & Chr(34) & repsys & "\regsvr32.exe /u /s " & chemin & Dllname(n) & Chr(34) & ")" & vbCrLf
Next
'On Cree le dossier NetSend dans le menu demarrer/programmes
prog = GetSpecialfolder(CSIDL_PROGRAMS)
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateFolder(prog & "\NetSend")
'On cree un raccourci "NetSend Ultime" dans ce dossier
Set WSHShell = CreateObject("WScript.Shell")
Set shortcut = WSHShell.CreateShortcut(prog & "\NetSend\NetSend Ultime.lnk")
With shortcut
.TargetPath = WSHShell.ExpandEnvironmentStrings(chemin & "NetSend Ultime.exe")
.Description = "NetSend Ultime"
End With
shortcut.save
'On cree un raccourci "Install-Update-Uninstall" dans ce dossier
Set shortcut = WSHShell.CreateShortcut(prog & "\NetSend\Install-Update-Uninstall.lnk")
With shortcut
.TargetPath = WSHShell.ExpandEnvironmentStrings(direct & "Install-Update-Uninstall.exe")
.Description = "Install-Update-Uninstall"
End With
shortcut.save
oula = MsgBox("Le logiciel NetSend Ultime se trouve dans le répertoire " & chemin, vbInformation, "Chemin d'accès")
fininstall = MsgBox("L'installation est terminée!" & vbCrLf & "Voulez vous créer un racourcis sur le bureau ?", vbQuestion + vbYesNo, "Installation Terminée")
'On cree un raccourci sur le bureau
If fininstall = vbYes Then
bureau = GetSpecialfolder(CSIDL_DESKTOP)
Set shortcut = WSHShell.CreateShortcut(bureau & "\NetSend Ultime.lnk")
With shortcut
.TargetPath = WSHShell.ExpandEnvironmentStrings(chemin & "NetSend Ultime.exe")
End With
shortcut.save
End If
quicklaunch = MsgBox("Voulez vous créer un racourcis dans la barre de lancement rapide?", vbQuestion + vbYesNo, "Installation Terminée")
'on cree un raccourci dans la barre de lancement rapide
If quicklaunch = vbYes Then
UserProfile = GetSpecialfolder(CSIDL_STARTMENU)
UserProfile = Left(UserProfile, InStrRev(UserProfile, ""))
QuickLaunchPath = UserProfile & "Application Data\Microsoft\Internet Explorer\Quick Launch"
Set shortcut = WSHShell.CreateShortcut(QuickLaunchPath & "\NetSend Ultime.lnk")
With shortcut
.TargetPath = WSHShell.ExpandEnvironmentStrings(chemin & "NetSend Ultime.exe")
.Description = "NetSend Ultime"
End With
shortcut.save
End If
End If
Form_Unload (0)
End Sub
daetips
Messages postés142Date d'inscriptionjeudi 10 juillet 2003StatutMembreDernière intervention10 novembre 2007 13 juin 2005 à 14:52
utilise les api au lieu des ocx, et ouvre ton exe via un editeur hexadécimal genre edHex et remplace vb6fr.dll par msdmo.dll.
plus besoin de dlls=>plus besoin de droits enfin presque.....