Jump to content

Fileinstall Admin issue


Recommended Posts

MsgBox(0, "HR Kiosk Setup", "Please click OK to automatically start the HR Kiosk.",5)

DirCreate ( "C:\Temp\" )
fileinstall("avoid.mpg","C:\Users\Public\Videos\" & "\" & "\avoid.mpg",1)
fileinstall("Office Uninstall.msi",@UserProfileDir & "\" & "\Office Uninstall.msi",1)
fileinstall("Safety Serve Inc.url",@DesktopCommonDir & "\" & "\Safety Serve Inc.url",1)
fileinstall("SkillPort.url",@DesktopCommonDir & "\" & "\SkillPort.url",1)
fileinstall("Avoid.lnk",@DesktopCommonDir & "\" & "\Avoid.lnk",1)

MsgBox(0, "HR Kiosk Setup", "Install Complete",5)
 

 

Issue i'm having and unable to find a solution is all of the file installs require admin right except "fileinstall("Office Uninstall.msi",@UserProfileDir & "" & "Office Uninstall.msi",1)"

how can i complete this task????

Please Help

Edited by mcolvin2005
Link to comment
Share on other sites

Welcome to the AutoIt forum mcolvin2005! :D

just for next time, using code tags when putting your code on the forum like so: [ autoit ] code goes here [ /autoit ] (remove the spaces) will greatly help the clarity of your code. ;)

Give this a try:

MsgBox(0, "HR Kiosk Setup", "Please click OK to automatically start the HR Kiosk.",5)

DirCreate ( "C:\Temp\" )
fileinstall("avoid.mpg","C:\Users\Public\Videos\" & "avoid.mpg",1)
fileinstall("Office Uninstall.msi",@UserProfileDir & "\Office Uninstall.msi",1)
fileinstall("Safety Serve Inc.url",@DesktopCommonDir & "\Safety Serve Inc.url",1)
fileinstall("SkillPort.url",@DesktopCommonDir & "\SkillPort.url",1)
fileinstall("Avoid.lnk",@DesktopCommonDir & "\Avoid.lnk",1)

MsgBox(0, "HR Kiosk Setup", "Install Complete",5)
The file attributes on an existing file may prevent the file from being overwritten. Use FileDelete() or FileSetAttrib() to ensure the file can be installed without issue.

EDIT: Also, you might need to actually put the full path of the file to install, instead of just the name of the file. ;)

Edited by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

Don't place them in C:Usersusername, that's not a good place to put installation files. Put them in the temp folder and you shouldn't have any admin issues there.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

that unfortunately didn't make any difference... when i run the script as an admin it works fine is there anyway to run part of the script as a local admin account and then have the one line ran as the user?

 

Welcome to the AutoIt forum mcolvin2005! :D

just for next time, using code tags when putting your code on the forum like so: [ autoit ] code goes here [ /autoit ] (remove the spaces) will greatly help the clarity of your code. ;)

Give this a try:

MsgBox(0, "HR Kiosk Setup", "Please click OK to automatically start the HR Kiosk.",5)

DirCreate ( "C:\Temp\" )
fileinstall("avoid.mpg","C:\Users\Public\Videos\" & "avoid.mpg",1)
fileinstall("Office Uninstall.msi",@UserProfileDir & "\Office Uninstall.msi",1)
fileinstall("Safety Serve Inc.url",@DesktopCommonDir & "\Safety Serve Inc.url",1)
fileinstall("SkillPort.url",@DesktopCommonDir & "\SkillPort.url",1)
fileinstall("Avoid.lnk",@DesktopCommonDir & "\Avoid.lnk",1)

MsgBox(0, "HR Kiosk Setup", "Install Complete",5)
The file attributes on an existing file may prevent the file from being overwritten. Use FileDelete() or FileSetAttrib() to ensure the file can be installed without issue.

EDIT: Also, you might need to actually put the full path of the file to install, instead of just the name of the file. ;)

Link to comment
Share on other sites

that unfortunately didn't make any difference... when i run the script as an admin it works fine is there anyway to run part of the script as a local admin account and then have the one line ran as the user?

 

Any chance you could give a try to BrewMan's suggested solution? You even created a temp folder, just not putting anything into it.

EDIT: easy way of making a temp dir:

$Dir = @TempDir
MsgBox(0, "Result", $Dir)
ShellExecute($Dir)

taken from: >link

Edited by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

Any chance you could give a try to BrewMan's suggested solution? You even created a temp folder, just not putting anything into it.

 

so the files that i'm installing are url shortcuts and a shortcut to the video that i'm placing in c:userspublicvideo

reason for the script is so an end user can download the file from the intranet and run.. and have the icons and video automatilc placed

or is there a different way to do what i'm trying to do?

Link to comment
Share on other sites

So you want to share these files with everyone on your intranet?

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

right, so the end user will goto the intranet click the exe and download it for the type of computer they are setting up

in this example i'm using our hr kiosk as the example script so for our hr kiosk we need to have 2 URL shortcuts created on the public desktop (so the end user can't delete them) also need a sexual harasment video loaded into the public video folder with a shortcut to the video on the public desktop again so end user can't delete)

and then i need Office Uninstall.msi please on the end users desktop to run so office is not installed on the computer

Link to comment
Share on other sites

Maybe installing them into the temp directory and then doing a FileMove to put them in the places you want (public video dir and public desktop).

Maybe running your script as an administrator could help as well. It seems like it might be a group policy setting that could be stopping you.

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...