GerrOrneq Posted May 25, 2014 Posted May 25, 2014 @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
jrsofsd Posted May 25, 2014 Posted May 25, 2014 Hi guinness Thanks for adding _StartupFolder_Install() and expecially _StartupRegistry_Exists(); much appreciated jrs
guinness Posted May 25, 2014 Author Posted May 25, 2014 Hi guinness Thanks for adding _StartupFolder_Install() and expecially _StartupRegistry_Exists(); much appreciated jrsYou'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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
jrsofsd Posted May 25, 2014 Posted May 25, 2014 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. How does one update a ZIP file? My searches didn't turn up anything. 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".
guinness Posted May 25, 2014 Author Posted May 25, 2014 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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
beqa Posted June 30, 2014 Posted June 30, 2014 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.
guinness Posted June 30, 2014 Author Posted June 30, 2014 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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
guinness Posted June 30, 2014 Author Posted June 30, 2014 hi. yep, it works, thanks.Brilliant.The issue was I was saying if the formatting is okay return an @error *facepalm*. mLipok 1 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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
mLipok Posted June 30, 2014 Posted June 30, 2014 (edited) 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 June 30, 2014 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 Code * for 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 API * ErrorLog.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 TaskScheduler * IE 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 stuff * OnHungApp handler * Avoid "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" , 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
guinness Posted June 30, 2014 Author Posted June 30, 2014 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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
guinness Posted March 12, 2015 Author Posted March 12, 2015 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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
damian666 Posted May 11, 2015 Posted May 11, 2015 (edited) when i use it on win10, it does add the startup entry in the folder, but it wont run? any idea what could be wrong? _StartupFolder_Install("Icon Changer.exe", Default, "/check") Edited May 11, 2015 by damian666 and proud of it!!!
guinness Posted May 11, 2015 Author Posted May 11, 2015 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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
damian666 Posted May 12, 2015 Posted May 12, 2015 yes it is present, thats whats weird about it :P and proud of it!!!
ViciousXUSMC Posted May 12, 2015 Posted May 12, 2015 (edited) 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:expandcollapse popup#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") EndFuncEdit: 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 splitHas a profound impact Edited May 12, 2015 by ViciousXUSMC
ViciousXUSMC Posted May 12, 2015 Posted May 12, 2015 (edited) 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.expandcollapse popup#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 May 12, 2015 by ViciousXUSMC
guinness Posted May 12, 2015 Author Posted May 12, 2015 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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
ViciousXUSMC Posted May 12, 2015 Posted May 12, 2015 (edited) 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 = TrueI 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.lnkbut 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 expandcollapse popup#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 EndFuncP.S. Install/Uninstall for a .lnk works for Registry just not for the Startup Folder Edited May 12, 2015 by ViciousXUSMC
TheDcoder Posted August 19, 2015 Posted August 19, 2015 Good work @guinness , I was gonna make my own version of this UDF, Good-thing that I used google after using the forum search! 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now