Jump to content

_Startup() - Create Startup entries in the Startup Folder or Registry.


guinness
 Share

Recommended Posts

@guinness

Thanks for sharing.

Just one small glitch!

You have updated the script in the post but have left the script unchanged in the .ZIP file,

plus Example1 updated in the post is different than the one in the zip file (just by the difference of removal of a backslash)

This may cause confusion for people like me who download the .ZIP files thinking that it will have all updates/changes in one place.

Good Luck,

DeMo.

Quote of the week:"BASIC programmers never die, they GOSUB and don't RETURN." -- UnknownWisdom of the ages:

  

  • I'd be unstoppable... if not for law enforcement and physics.
  • Marriage, the number 1 cause of divorce.
  • Don't steal... the government hates competition.
  • Irish Government Motto: We’ve got what it takes to take what you’ve got.
  • Birthdays are good for you. Statistics show that the people who have the most live the longest.
  • Failure is not an option. It comes bundled with your Microsoft product.-- Ferenc Mantfeld
  • If you learn from your mistakes, then why ain't I a genius?! -- Anonymous
  • Remember, live every day as if it was your last day! one day you will be right.
  • How is it one careless match can start a forest fire, but it takes a whole box to start a campfire?
  • Sure my system is secure, it just locked up again.
  • I haven't lost my mind; I have a tape back-up somewhere.  ~Author Unknown
Link to comment
Share on other sites

Hi guinness

 

Thanks for adding _StartupFolder_Install() and expecially _StartupRegistry_Exists(); much appreciated :geek:

 

jrs

You're welcome.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Hi guinness

I made the same "mistake" as an another poster - I assumed the latest version of _Startup (or any other UDF) was located in the ZIP file. I'm aware this is probably not the right place to broach this, but since you're friendly, responsive, and influential I'm going to take a chance.

  1. How does one update a ZIP file? My searches didn't turn up anything.
     
  2. Shouldn't UDF's be managed on GitHub or SourceForge, with version control? Experimental modifications to stable UDF's could easily be "released", but labeled as purely experimental. I favor limiting code embedded in posts  to fragments rather then complete UDF's.

I look forward to seeing your comments!

BTW, your newly coded version of _Startup() was very instructive, especially your use of "Local Const". :geek:

Link to comment
Share on other sites

This UDF has nothing to do with the AutoIt UDFs, this is just a custom UDF I have created myself. As for upgrading just unzip the file and copy _Startup.au3 to either AutoIt's include folder or the location of your main script. I use github for non-AutoIt related coding.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

  • 1 month later...

hello.

yesterday i needed autostart function to be added to my program.

i downloaded startup udf and tried to run examples.

it didn't work.

what i can do?

windows 7 ultimate sp1 x64

and autoit version 3.3.10.2

please help.

Link to comment
Share on other sites

Thanks for reporting. I was being an idiot and fixed my stupid mistake. Please try again!

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

hi.

 

yep, it works, thanks.

Brilliant.

The issue was I was saying if the formatting is okay return an @error *facepalm*.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

I was being an idiot and fixed my stupid mistake. Please try again!

 

The issue was I was saying if the formatting is okay return an @error *facepalm*.

 

Self-criticism proves the greatness of man.

EDIT:

This was praise, or so it would sound like.

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

Well I hate to look bad in the eyes of others, but on this occasion it had to be done.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

  • 8 months later...

Updated UDF by replacing $f with $b for boolean values and included constants as well.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

  • 1 month later...

No clue as I don't have Windows 10. Does it add it to the Windows Startup folder?

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Was this intended to be a separate script to install a .exe for startup or to be inside of the .exe so that it self installs for startup when you run it once? 

I use several startup scripts and just use the @StartupCommonDir with some copy commands to install my .exes.
I am thinking maybe doing a little drag & drop GUI with this UDF though as a universal startup installer so I can just drag any .exe to the GUI and install it without writing an installer for each application.  

Edit:

So I started on my little drag & drop idea.

So far I have the left & right drop areas working independently and have started to code the function for the left side, intergrating the "All Users" checkbox but not yet the "Uninstall" box.

I stopped here because I ran into an issue.

The install works, but it only works first time for the first file.  If I drop one file in and then another it does not work until I exit the script and open it again.  Same behavior for dragging in more than one file.  My array display and message box when uncommented shows that the function is running each time and properly cycling through the file names.  It's almost as if the _StartupFolder_Install function itself refuses to run more than once.

I figured you may want to key in and show me my error, or verify its the function that is my issue and not my code.

Current code:

#RequireAdmin
#Include <_Startup.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 449, 186, 192, 124, -1, $WS_EX_ACCEPTFILES)
$Edit1 = GUICtrlCreateEdit("", 24, 72, 185, 89)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUICtrlSetData(-1, "Drag Here")
$Edit2 = GUICtrlCreateEdit("", 248, 72, 185, 89)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUICtrlSetData(-1, "Drag Here")
$Label1 = GUICtrlCreateLabel("Install To Startup", 64, 32, 84, 17)
$Label2 = GUICtrlCreateLabel("Install To Registry", 296, 32, 88, 17)
$Checkbox1 = GUICtrlCreateCheckbox("All Users", 64, 48, 97, 17)
$Checkbox2 = GUICtrlCreateCheckbox("All Users", 296, 48, 97, 17)
$Checkbox3 = GUICtrlCreateCheckbox("Uninstall", 64, 162, 97, 17)
$Checkbox4 = GUICtrlCreateCheckbox("Uninstall", 296, 162, 97, 17)
$Label3 = GUICtrlCreateLabel("Drag and Drop Item to Install", 112, 0, 238, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_DROPPED
            If @GUI_DropId = 3 Then LeftBox()
            If @GUI_DropID = 4 Then RightBox()
    EndSwitch
WEnd

Func LeftBox()
            If GUICtrlRead($CheckBox1) = $GUI_CHECKED Then
                $bAllusers = True
            Else
                $bAllusers = False
            EndIf

            $data =  GUICtrlRead($Edit1)
            $aSplitData = StringSplit($data, @LF, 2)
            ;_ArrayDisplay($aSplitData)
            For $i = 0 to UBound($aSplitData) - 1
            ;MsgBox(0, "", $aSplitData[$i])
            $sFilePath = ($aSplitData[$i])
            $sName = StringTrimLeft($sFilePath, StringinStr($sFilePath, "\", 0, -1))
            _StartupFolder_Install($sName, $sFilePath, "", $bAllusers)
            Next

            GUICtrlSetData($Edit1, "Drag Here")
EndFunc

Func RightBox()
            $data =  GUICtrlRead($Edit2)
            $aSplitData = StringSplit($data, @LF, 2)
            ;_ArrayDisplay($aSplitData)
            For $i = 0 to UBound($aSplitData) - 1
            MsgBox(0, "", $aSplitData[$i])
            Next
            GUICtrlSetData($Edit2, "Drag Here")
EndFunc

Edit: Ok figured out most of the issue.  File name is getting prefixed with the "Drag Here" on the 2nd file onward not sure the proper fix but my fix was to change the text in those fields to blank "" and now I can drag a file in and then another and it works over and over for as many files as I want.

My next issue is the multiple files at once, for some reason I get an extra line break on all the additional files dragged in.

With Input controls I feed my files names with StringSplit($data, "|", 2) but with Edit controls I see there is no pipe character between entries, via trial and error I found that @LF seems to feed them to an array but I assume somewhere in there is my issue. 

Edit: Hurray!  Figured out the issue I needed to change StringSplit to StringSplit($data, @CRLF, 3) apparently the 

 $STR_ENTIRESPLIT (1) = entire delimiter string is needed to mark the split

Has a profound impact :)

Edited by ViciousXUSMC
Link to comment
Share on other sites

Hmm working on the UnInstall Part now.

Function is firing as it is supposed to and it is throwing no errors (Return 0 for @Error) but its not actually uninstalling anything.  I have tried feeding it the same file path that I installed from and also the file path for the actual startup directory.

#RequireAdmin
#Include <_Startup.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 449, 186, 192, 124, -1, $WS_EX_ACCEPTFILES)
$Edit1 = GUICtrlCreateEdit("", 24, 72, 185, 89)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUICtrlSetData(-1, "")
$Edit2 = GUICtrlCreateEdit("", 248, 72, 185, 89)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUICtrlSetData(-1, "")
$Label1 = GUICtrlCreateLabel("Install To Startup", 64, 32, 84, 17)
$Label2 = GUICtrlCreateLabel("Install To Registry", 296, 32, 88, 17)
$Checkbox1 = GUICtrlCreateCheckbox("All Users", 64, 48, 97, 17)
$Checkbox2 = GUICtrlCreateCheckbox("All Users", 296, 48, 97, 17)
$Checkbox3 = GUICtrlCreateCheckbox("Uninstall", 64, 162, 97, 17)
$Checkbox4 = GUICtrlCreateCheckbox("Uninstall", 296, 162, 97, 17)
$Label3 = GUICtrlCreateLabel("Drag and Drop Item to Install", 112, 0, 238, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_DROPPED
            If @GUI_DropId = 3 AND GUICtrlRead($Checkbox3) = $GUI_UNCHECKED Then LeftBoxInstall()
            If @GUI_DropID = 3 AND GUICtrlRead($Checkbox3) = $GUI_CHECKED Then LeftBoxUninstall()
            If @GUI_DropID = 4 AND GUICtrlRead($Checkbox4) = $GUI_UNCHECKED Then RightBoxInstall()
            If @GUI_DropID = 4 AND GUICtrlRead($Checkbox4) = $GUI_CHECKED Then RightBoxUnInstall()

    EndSwitch
WEnd

Func LeftBoxInstall()

            If GUICtrlRead($CheckBox1) = $GUI_CHECKED Then
                $bAllusers = True
            Else
                $bAllusers = False
            EndIf

            $data =  GUICtrlRead($Edit1)
            $aSplitData = StringSplit($data, @CRLF, 3)
            ;Debut See what is in Array
            ;_ArrayDisplay($aSplitData)
            For $i = 0 to UBound($aSplitData) - 1
            ;Debug See what current file is in Array
            ;MsgBox(0, "", $aSplitData[$i])
            $sFilePath = ($aSplitData[$i])
            $sName = StringTrimLeft($sFilePath, StringinStr($sFilePath, "\", 0, -1))
            _StartupFolder_Install($sName, $sFilePath, "", $bAllusers)
            ;Debug See full varible list sent to Function
            ;MsgBox(0, "", $sName & @CRLF & $sFilePath & @CRLF & $bAllusers)
            Next

            GUICtrlSetData($Edit1, "")

EndFunc

Func LeftBoxUninstall()

    If GUICtrlRead($CheckBox1) = $GUI_CHECKED Then
                $bAllusers = True
            Else
                $bAllusers = False
            EndIf

            $data =  GUICtrlRead($Edit1)
            $aSplitData = StringSplit($data, @CRLF, 3)
            ;Debut See what is in Array
            _ArrayDisplay($aSplitData)
            For $i = 0 to UBound($aSplitData) - 1
            ;Debug See what current file is in Array
            MsgBox(0, "", $aSplitData[$i])
            $sFilePath = ($aSplitData[$i])
            $sName = StringTrimLeft($sFilePath, StringinStr($sFilePath, "\", 0, -1))
            _StartupFolder_Uninstall($sName, $sFilePath, $bAllusers)
            MsgBox(0, "", @error)
            ;Debug See full varible list sent to Function
            MsgBox(0, "", $sName & @CRLF & $sFilePath & @CRLF & $bAllusers)
            Next

            GUICtrlSetData($Edit1, "")
EndFunc

Func RightBoxInstall()
            MsgBox(0, "", "RightBox Install")
            GUICtrlSetData($Edit2, "")
EndFunc

Func RightBoxUnInstall()
    MsgBox(0, "", "RightBox UnInstall")
    GUICtrlSetData($Edit2, "")
EndFunc

 

Edited by ViciousXUSMC
Link to comment
Share on other sites

Do I need to be here for this conversation? Or are you sorting this out yourself?

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

I post questions when I am stuck and hope for answers but keep trying myself so that I can learn and put forth due diligence. (and I edit when I figure things out to save somebody answering something I figured out)

So far on this one, I am stuck as to why it is not uninstalling.  As far as I can tell all the data is entering the function correctly and I have #RequireAdmin as well.

Other than that piece of the puzzle I think I can get the right drop area up and going myself based on the same concepts I used for the left.

Something tells me the data I am sending to the function needs to be different, but I am unsure.

Here is an example of my variable values that work for install but fail for uninstall.

$sName = Cisco Packet Tracer.lnk

$sFilePath = C:\Users\it022565\Desktop\Cisco Packet Tracer.lnk

$bAllusers = True

I have also tried to drag/drop the actual file location where it installs thus changing the path to

$sFilePath = C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\Cisco Packet Tracer.lnk

but in both cases the files remain installed.

I would think maybe I need quotes around my values since they have spaces, but if the install works I do not see why the uninstall would not.

 

Edit: And so I figured it out by looking at your actual function.

You're not moving/copying the actual file to the startup dir, but instead just creating a .lnk to it.

If the file is already a .lnk as I was testing with it will install a .lnk to startup but it will not remove it. :)

 

My home brew installers usually put the .exe or file directly into the startup directory just a personal preference as only one thing for me to keep track of rather than 2 files. 

 

Edit: And after figuring that out I finished off the GUI and it appears to be fully working.  Hope you like it for being a code novice :)

#RequireAdmin
#Include <_Startup.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Run At Startup Installer", 530, 186, 192, 124, -1, $WS_EX_ACCEPTFILES)
$Edit1 = GUICtrlCreateEdit("", 24, 72, 185, 89)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUICtrlSetData(-1, "")
$Edit2 = GUICtrlCreateEdit("", 248, 72, 185, 89)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUICtrlSetData(-1, "")
$Label1 = GUICtrlCreateLabel("Install To Startup", 64, 32, 84, 17)
$Label2 = GUICtrlCreateLabel("Install To Registry", 296, 32, 88, 17)
$Checkbox1 = GUICtrlCreateCheckbox("All Users", 64, 48, 97, 17)
$Checkbox2 = GUICtrlCreateCheckbox("All Users", 296, 48, 97, 17)
$Checkbox3 = GUICtrlCreateCheckbox("Uninstall", 64, 162, 97, 17)
$Checkbox4 = GUICtrlCreateCheckbox("Uninstall", 296, 162, 97, 17)
$Label3 = GUICtrlCreateLabel("Drag and Drop Item to Install", 112, 0, 238, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$Radio1 = GUICtrlCreateRadio("Always", 438, 76, 113, 17)
$Radio2 = GUICtrlCreateRadio("RunOnce", 438, 92, 113, 17)
$Radio3 = GUICtrlCreateRadio("RunOnceEX", 438, 108, 113, 17)
GUICtrlSetState($Radio1, $GUI_CHECKED)
GUICtrlSetState($Checkbox1, $GUI_CHECKED)
GUICtrlSetState($Checkbox2, $GUI_CHECKED)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_DROPPED
            If @GUI_DropId = 3 AND GUICtrlRead($Checkbox3) = $GUI_UNCHECKED Then LeftBoxInstall()
            If @GUI_DropID = 3 AND GUICtrlRead($Checkbox3) = $GUI_CHECKED Then LeftBoxUninstall()
            If @GUI_DropID = 4 AND GUICtrlRead($Checkbox4) = $GUI_UNCHECKED Then RightBoxInstall()
            If @GUI_DropID = 4 AND GUICtrlRead($Checkbox4) = $GUI_CHECKED Then RightBoxUnInstall()

    EndSwitch
WEnd

Func LeftBoxInstall()
            If GUICtrlRead($CheckBox1) = $GUI_CHECKED Then
                $bAllusers = True
            Else
                $bAllusers = False
            EndIf

            $data =  GUICtrlRead($Edit1)
            $aSplitData = StringSplit($data, @CRLF, 3)
            ;Debut See what is in Array
            ;_ArrayDisplay($aSplitData)
            For $i = 0 to UBound($aSplitData) - 1
            ;Debug See what current file is in Array
            ;MsgBox(0, "", $aSplitData[$i])
            $sFilePath = ($aSplitData[$i])
            $sName = StringTrimLeft($sFilePath, StringinStr($sFilePath, "\", 0, -1))
            _StartupFolder_Install($sName, $sFilePath, "", $bAllusers)
            ;Debug See full varible list sent to Function
            ;MsgBox(0, "", $sName & @CRLF & $sFilePath & @CRLF & $bAllusers)
            Next

            GUICtrlSetData($Edit1, "")
EndFunc

Func LeftBoxUninstall()
    If GUICtrlRead($CheckBox1) = $GUI_CHECKED Then
                $bAllusers = True
            Else
                $bAllusers = False
            EndIf

            $data =  GUICtrlRead($Edit1)
            $aSplitData = StringSplit($data, @CRLF, 3)
            ;Debug See what is in Array
            ;_ArrayDisplay($aSplitData)
            For $i = 0 to UBound($aSplitData) - 1
            ;Debug See what current file is in Array
            ;MsgBox(0, "", $aSplitData[$i])
            $sFilePath = ($aSplitData[$i])
            $sName = StringTrimLeft($sFilePath, StringinStr($sFilePath, "\", 0, -1))
            _StartupFolder_Uninstall($sName, $sFilePath, $bAllusers)
            ;Debug See full varible list sent to Function
            ;MsgBox(0, "", $sName & @CRLF & $sFilePath & @CRLF & $bAllusers)
            Next

            GUICtrlSetData($Edit1, "")
EndFunc

Func RightBoxInstall()
    If GUICtrlRead($CheckBox2) = $GUI_CHECKED Then
                $bAllusers = True
            Else
                $bAllusers = False
            EndIf

            $iRunOnce = CheckRadio()

            $data =  GUICtrlRead($Edit2)
            $aSplitData = StringSplit($data, @CRLF, 3)
            ;Debug See what is in Array
            ;_ArrayDisplay($aSplitData)
            For $i = 0 to UBound($aSplitData) - 1
            ;Debug See what current file is in Array
            ;MsgBox(0, "", $aSplitData[$i])
            $sFilePath = ($aSplitData[$i])
            $sName = StringTrimLeft($sFilePath, StringinStr($sFilePath, "\", 0, -1))
            _StartupRegistry_Install($sName, $sFilePath, "", $bAllusers, $iRunOnce)
            ;Debug See full varible list sent to Function
            ;MsgBox(0, "", $sName & @CRLF & $sFilePath & @CRLF & $bAllusers)
            Next

            GUICtrlSetData($Edit2, "")
EndFunc

Func RightBoxUnInstall()
    If GUICtrlRead($CheckBox2) = $GUI_CHECKED Then
                $bAllusers = True
            Else
                $bAllusers = False
            EndIf

            $iRunOnce = CheckRadio()

            $data =  GUICtrlRead($Edit2)
            $aSplitData = StringSplit($data, @CRLF, 3)
            ;Debug See what is in Array
            ;_ArrayDisplay($aSplitData)
            For $i = 0 to UBound($aSplitData) - 1
            ;Debug See what current file is in Array
            ;MsgBox(0, "", $aSplitData[$i])
            $sFilePath = ($aSplitData[$i])
            $sName = StringTrimLeft($sFilePath, StringinStr($sFilePath, "\", 0, -1))
            _StartupRegistry_Uninstall($sName, $sFilePath, $bAllusers, $iRunOnce)
            ;Debug See full varible list sent to Function
            ;MsgBox(0, "", $sName & @CRLF & $sFilePath & @CRLF & $bAllusers)
            Next

            GUICtrlSetData($Edit2, "")
EndFunc

Func CheckRadio()
    If GUICtrlRead($Radio1) = $GUI_CHECKED Then Return $STARTUP_RUN
    If GUICtrlRead($Radio2) = $GUI_CHECKED Then Return $STARTUP_RUNONCE
    If GUICtrlRead($Radio3) = $GUI_CHECKED Then Return $STARTUP_RUNONCEEX
EndFunc

P.S. Install/Uninstall for a .lnk works for Registry just not for the Startup Folder

Edited by ViciousXUSMC
Link to comment
Share on other sites

  • 3 months later...

Good work @guinness :), I was gonna make my own version of this UDF, Good-thing that I used google after using the forum search! :P

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

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...