This one is much more flexible ... and better coded.
When you create a project folder, you enter basic information about the project, select a template (AU3, PAS, C, PHP, ... anything you create) and a profile (information about yourself) to use in creating the project folder. The folder is then created, and variable substitution applied to populate the folder with the files needed for the project. Using this utility, I have profiles for each client I write scripts for, as well as one for scripts I write for myself.
Play around with it, and you will see how useful it can be.
---------- Latest Code ----------
MyProjectFolder.au3
Spoiler
AutoIt
#region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=icons\MyProjectFolder.ico #AutoIt3Wrapper_Outfile=MyProjectFolder.exe #AutoIt3Wrapper_Outfile_x64=MyProjectFolder64.exe #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_Compile_Both=y #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Res_Description=Creates a new project folder based on the selected template and profile #AutoIt3Wrapper_Res_Fileversion=1.0.0.20 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Res_Language=1033 #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker ://////=__= ://////=__==willichan) ://////=__=://.= #AutoIt3Wrapper_AU3Check_Stop_OnWarning=y #AutoIt3Wrapper_Run_Tidy=y #AutoIt3Wrapper_Run_Obfuscator=y #Obfuscator_Parameters=/striponly #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- Project Name: New Project Folder Description: Creates a new project folder based on the selected template and profile AutoIt Version: v3.3.6.1 Author: David Williams (willichan) Email: david@optionsintegrated.com website: http://optionsintegrated.com Company: Options Integrated Creation Date: 9/30/2010 #ce ---------------------------------------------------------------------------- #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Date.au3> Opt("MustDeclareVars", 1) ;0=no, 1=require pre-declare Opt("TrayAutoPause", 0) ;0=no pause, 1=Pause Opt("TrayMenuMode", 0) ;0=append, 1=no default menu, 2=no automatic check, 4=menuitemID not return Opt("TrayIconHide", 0) ;0=show, 1=hide tray icon Opt("GUIOnEventMode", 1) Global Const $MyName = "MyProjectFolder" Global Const $datapath = @AppDataCommonDir & "\MyProjectFolder\" Global Const $IniFile = @AppDataCommonDir & "\MyProjectFolder.ini" Global $vars, $delimiter, $mymutex Global $frm_main, $frm_main_loop Global $frm_main_lbl_path, $frm_main_path Global $frm_main_lbl_longname, $frm_main_longname Global $frm_main_lbl_shortname, $frm_main_shortname Global $frm_main_lbl_description, $frm_main_description Global $frm_main_lbl_profile, $frm_main_profile Global $frm_main_lbl_template, $frm_main_template Global $frm_main_OK, $frm_main_Cancel SRandom(@YDAY & @MSEC) $mymutex = Hex(Random(0, 65535, 1), 4) & Hex(Random(0, 65535, 1), 4) & Hex(Random(0, 65535, 1), 4) & Hex(Random(0, 65535, 1), 4) _frm_main() Func _frm_main() ;form Global $frm_main = GUICreate("New Project Folder", 412, 235, 194, 233) GUISetFont(7, 400, 0, "MS Sans Serif") GUISetOnEvent($GUI_EVENT_CLOSE, "_frm_main_Close") GUISetOnEvent($GUI_EVENT_MINIMIZE, "_frm_main_Minimize") GUISetOnEvent($GUI_EVENT_RESTORE, "_frm_main_Restore") If $CmdLine[0] = 0 Then ;path Global $frm_main_lbl_path = GUICtrlCreateLabel("Target Path:", 8, 8, 63, 17, 0) Global $frm_main_path = GUICtrlCreateInput("", 80, 8, 303, 21) GUICtrlSetTip($frm_main_path, "Path where the new folder should be created") Global $frm_main_browse = GUICtrlCreateButton("...", 384, 8, 19, 21, $WS_GROUP) GUICtrlSetTip($frm_main_browse, "Browse") GUICtrlSetOnEvent($frm_main_browse, "_frm_main_browse_click") EndIf ;long name $frm_main_lbl_longname = GUICtrlCreateLabel("Long Name:", 8, 40, 62, 17, 0) $frm_main_longname = GUICtrlCreateInput("", 80, 40, 321, 21, $GUI_SS_DEFAULT_INPUT) GUICtrlSetTip($frm_main_longname, "Full name of the project") GUICtrlSetOnEvent($frm_main_longname, "_frm_main_longname_Change") ;short name $frm_main_lbl_shortname = GUICtrlCreateLabel("Short Name:", 8, 72, 63, 17, 0) $frm_main_shortname = GUICtrlCreateInput("", 80, 72, 321, 21, $GUI_SS_DEFAULT_INPUT) GUICtrlSetTip($frm_main_shortname, "Short name for project (and name of the new folder)") ;description $frm_main_lbl_description = GUICtrlCreateLabel("Description:", 8, 104, 60, 17, 0) $frm_main_description = GUICtrlCreateInput("", 80, 104, 321, 21, $GUI_SS_DEFAULT_INPUT) GUICtrlSetTip($frm_main_description, "Description of the new project") ;profile $frm_main_lbl_profile = GUICtrlCreateLabel("Profile:", 8, 136, 36, 17) $frm_main_profile = GUICtrlCreateCombo("", 80, 136, 321, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetTip($frm_main_profile, "Profile (your info) to use for this project") ;template $frm_main_lbl_template = GUICtrlCreateLabel("Template:", 8, 168, 51, 17) $frm_main_template = GUICtrlCreateCombo("", 80, 168, 321, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetTip($frm_main_template, "Project template to use") ;ok button $frm_main_OK = GUICtrlCreateButton("OK", 16, 200, 179, 25) GUICtrlSetOnEvent($frm_main_OK, "_frm_main_OK_Click") GUICtrlSetTip($frm_main_OK, "Create the project folder") ;cancel button $frm_main_Cancel = GUICtrlCreateButton("Cancel", 216, 200, 179, 25) GUICtrlSetOnEvent($frm_main_Cancel, "_frm_main_Cancel_Click") GUICtrlSetTip($frm_main_Cancel, "Abort the new project folder") If $CmdLine[0] > 0 Then ;path Global $frm_main_lbl_path = GUICtrlCreateLabel("Target Path:", 8, 8, 63, 17, 0) Global $frm_main_path = GUICtrlCreateInput("", 80, 8, 303, 21) GUICtrlSetTip($frm_main_path, "Path where the new folder should be created") Global $frm_main_browse = GUICtrlCreateButton("...", 384, 8, 19, 21, $WS_GROUP) GUICtrlSetTip($frm_main_browse, "Browse") GUICtrlSetOnEvent($frm_main_browse, "_frm_main_browse_click") EndIf ;load default values _frm_main_LoadDefaults() ;run the GUI GUISetState(@SW_SHOW, $frm_main) $frm_main_loop = True While $frm_main_loop Sleep(100) WEnd EndFunc ;==>_frm_main Func _frm_main_Close() _frm_main_Cancel_Click() EndFunc ;==>_frm_main_Close Func _frm_main_Minimize() EndFunc ;==>_frm_main_Minimize Func _frm_main_Restore() EndFunc ;==>_frm_main_Restore Func _frm_main_browse_click() Local $ret $ret = FileSelectFolder("Select folder where project folder will be created", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", 7, StringStripWS(GUICtrlRead($frm_main_path), 8)) If $ret <> "" Then GUICtrlSetData($frm_main_path, $ret) EndFunc ;==>_frm_main_browse_click Func _frm_main_longname_Change() Local $short = GUICtrlRead($frm_main_shortname) If StringStripWS($short, 3) = "" Then GUICtrlSetData($frm_main_shortname, StringStripWS(GUICtrlRead($frm_main_longname), 8)) EndIf EndFunc ;==>_frm_main_longname_Change Func _frm_main_OK_Click() If Not _frm_main_ValidEntries() Then Return GUISetState(@SW_HIDE, $frm_main) $frm_main_loop = False _frm_main_SaveDefaluts() _CreateFolder() EndFunc ;==>_frm_main_OK_Click Func _frm_main_Cancel_Click() GUISetState(@SW_HIDE, $frm_main) $frm_main_loop = False EndFunc ;==>_frm_main_Cancel_Click Func _frm_main_SaveDefaluts() IniWrite($IniFile, "LastValues", "profile", GUICtrlRead($frm_main_profile)) IniWrite($IniFile, "LastValues", "template", GUICtrlRead($frm_main_template)) EndFunc ;==>_frm_main_SaveDefaluts Func _frm_main_LoadDefaults() Local $temp1, $temp2 ;;path Switch $CmdLine[0] Case 0 ;No path provided, use @WorkingDir $temp1 = @WorkingDir If StringRight($temp1, 1) <> "\" Then $temp1 &= "\" Case 1 $temp1 = $CmdLine[1] ;Path given on command line Case Else $temp1 = $CmdLine[2] ;Path given through context menu EndSwitch $temp1 = StringLeft($temp1, StringInStr($temp1, "\", 0, -1)) GUICtrlSetData($frm_main_path, $temp1) ;;profile $temp1 = _GetProfiles() $temp2 = IniRead($IniFile, "LastValues", "profile", "") GUICtrlSetData($frm_main_profile, $temp1, $temp2) ;;template $temp1 = _GetTemplates() $temp2 = IniRead($IniFile, "LastValues", "template", "") GUICtrlSetData($frm_main_template, $temp1, $temp2) EndFunc ;==>_frm_main_LoadDefaults Func _frm_main_ValidEntries() Local $Invalid = "" If StringStripWS(GUICtrlRead($frm_main_path), 3) = "" Then $Invalid &= @CRLF & "Target Path" If StringStripWS(GUICtrlRead($frm_main_longname), 3) = "" Then $Invalid &= @CRLF & "Long Name" If StringStripWS(GUICtrlRead($frm_main_shortname), 3) = "" Then $Invalid &= @CRLF & "Short Name" If StringStripWS(GUICtrlRead($frm_main_profile), 3) = "" Then $Invalid &= @CRLF & "Profile" If StringStripWS(GUICtrlRead($frm_main_template), 3) = "" Then $Invalid &= @CRLF & "Template" If $Invalid = "" Then Return True MsgBox(8192 + 48, "MyProjectFolder Warning", "The following fields must have valid entries:" & $Invalid) Return False EndFunc ;==>_frm_main_ValidEntries Func _GetProfiles() Local $search, $file Local $found = "" $search = FileFindFirstFile($datapath & "profiles\*.ini") If $search = -1 Then Return "" EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop If StringLower(IniRead($datapath & "profiles\" & $file, "config", "status", "")) = "active" Then $found &= "|" & StringLeft($file, StringInStr($file, ".", 0, -1) - 1) EndIf WEnd FileClose($search) If $found <> "" Then $found = StringRight($found, StringLen($found) - 1) Return $found EndFunc ;==>_GetProfiles Func _GetTemplates() Local $search, $file Local $found = "" $search = FileFindFirstFile($datapath & "templates\*.*") If $search = -1 Then Return "" EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop If StringLower(IniRead($datapath & "templates\" & $file & "\template.ini", "config", "status", "")) = "active" Then $found &= "|" & $file EndIf WEnd FileClose($search) If $found <> "" Then $found = StringRight($found, StringLen($found) - 1) Return $found EndFunc ;==>_GetTemplates Func _CreateFolder() Local $files, $NewPath, $source, $target, $i, $data, $attrib, $activedir $vars = IniReadSection($datapath & "profiles\" & StringStripWS(GUICtrlRead($frm_main_profile), 3) & ".ini", "variables") If @error Then MsgBox(8192 + 16, $MyName & " Error", "Unable to read " & @ScriptDir & "\profiles\" & StringStripWS(GUICtrlRead($frm_main_profile), 3) & ".ini" & @CRLF & "Profile may be corrupt") Exit 2 EndIf $files = IniReadSection($datapath & "templates\" & StringStripWS(GUICtrlRead($frm_main_template), 3) & "\template.ini", "files") If @error Then MsgBox(8192 + 16, $MyName & " Error", "Unable to read " & $datapath & "templates\" & StringStripWS(GUICtrlRead($frm_main_template), 3) & "\template.ini" & @CRLF & "Template may be corrupt") Exit 1 EndIf $delimiter = IniRead($datapath & "templates\" & StringStripWS(GUICtrlRead($frm_main_template), 3) & "\template.ini", "config", "variablemarker", "__") $NewPath = StringStripWS(GUICtrlRead($frm_main_path), 3) If StringRight($NewPath, 1) <> "\" Then $NewPath &= "\" $NewPath &= StringStripWS(GUICtrlRead($frm_main_shortname), 3) DirCreate($NewPath) FileSetAttrib($NewPath, "+s") If $files[0][0] > 0 Then For $i = 1 To $files[0][0] $source = $files[$i][1] While StringLeft($source, 1) = "\" $source = StringStripWS(StringRight($source, StringLen($source) - 1), 1) WEnd $target = $source If StringInStr("fr", StringLower($files[$i][0])) Then _ReplaceVariables($target) $attrib = FileGetAttrib($datapath & "templates\" & StringStripWS(GUICtrlRead($frm_main_template), 3) & "\include\" & $source) StringReplace($attrib, "N", "") StringReplace($attrib, "D", "") StringReplace($attrib, "O", "") StringReplace($attrib, "C", "") StringReplace($attrib, "T", "") $data = FileRead($datapath & "templates\" & StringStripWS(GUICtrlRead($frm_main_template), 3) & "\include\" & $source) If StringInStr("fp", StringLower($files[$i][0])) Then _ReplaceVariables($data) If StringInStr($target, "\") Then DirCreate($NewPath & "\" & StringLeft($target, StringInStr($target, "\", 0, -1) - 1)) FileWrite($NewPath & "\" & $target, $data) FileSetAttrib($NewPath & "\" & $target, "+" & $attrib) Next EndIf $files = IniReadSection($datapath & "templates\" & StringStripWS(GUICtrlRead($frm_main_template), 3) & "\template.ini", "execute") If Not @error Then If $files[0][0] > 0 Then For $i = 1 To $files[0][0] $activedir = StringLeft($NewPath & "\" & $files[$i][1], StringInStr($NewPath & "\" & $files[$i][1], "\", 0, -1) - 1) Switch StringLower(StringRight($files[$i][1], StringLen($files[$i][1]) - StringInStr($files[$i][1], ".", 0, -1))) Case "bat", "cmd" RunWait(@ComSpec & " /c " & '"' & $NewPath & "\" & $files[$i][1] & '"', $activedir) Case Else ShellExecuteWait($NewPath & "\" & $files[$i][1], "", $activedir) EndSwitch Next EndIf EndIf EndFunc ;==>_CreateFolder Func _ReplaceVariables(ByRef $thestring) Local $i $thestring = StringReplace($thestring, _Delimited("templatepath"), $datapath & "templates\" & StringStripWS(GUICtrlRead($frm_main_template), 3) & "\include", 0, 1) $thestring = StringReplace($thestring, _Delimited("nameshort"), StringStripWS(GUICtrlRead($frm_main_shortname), 3), 0, 1) $thestring = StringReplace($thestring, _Delimited("namelong"), StringStripWS(GUICtrlRead($frm_main_shortname), 3), 0, 1) $thestring = StringReplace($thestring, _Delimited("autoitver"), RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "Version"), 0, 1) $thestring = StringReplace($thestring, _Delimited("date"), _NowDate(), 0, 1) $thestring = StringReplace($thestring, _Delimited("description"), StringStripWS(GUICtrlRead($frm_main_description), 3), 0, 1) $thestring = StringReplace($thestring, _Delimited("mutex"), $mymutex, 0, 1) If $vars[0][0] > 0 Then For $i = 1 To $vars[0][0] $thestring = StringReplace($thestring, _Delimited($vars[$i][0]), $vars[$i][1], 0, 1) Next EndIf EndFunc ;==>_ReplaceVariables Func _Delimited($thestring) Return $delimiter & $thestring & $delimiter EndFunc ;==>_Delimited
install.au3
Spoiler
AutoIt
#region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=icons\install.ico #AutoIt3Wrapper_Outfile=install.exe #AutoIt3Wrapper_Outfile_x64=install64.exe #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_Compile_Both=y #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Res_Description=Installs the MyProjectFolder utility #AutoIt3Wrapper_Res_Fileversion=1.0.1.24 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Res_LegalCopyright=Copyright 2009, 2010 by David (willichan) Williams #AutoIt3Wrapper_Res_Language=1033 #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator #AutoIt3Wrapper_AU3Check_Stop_OnWarning=y #AutoIt3Wrapper_Run_Tidy=y #AutoIt3Wrapper_Run_Obfuscator=y #Obfuscator_Parameters=/striponly #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** Global Const $installpath = @ProgramFilesDir & "\MyProjectFolder\" Global Const $datapath = @AppDataCommonDir & "\MyProjectFolder\" Global Const $extension = ".mypf" Global Const $classname = "MyProjectFolder" Global Const $menutext = "MyProject Folder" #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) Global $frm_install_loop = True Global $frm_install = GUICreate("Install", 180, 138, 192, 132) GUISetFont(7, 400, 0, "MS Sans Serif") GUISetOnEvent($GUI_EVENT_CLOSE, "frm_installClose") GUISetOnEvent($GUI_EVENT_MINIMIZE, "frm_installMinimize") GUISetOnEvent($GUI_EVENT_RESTORE, "frm_installRestore") Global $frm_install_context = GUICtrlCreateCheckbox("Add to context menu", 8, 8, 153, 17) GUICtrlSetState($frm_install_context, $GUI_CHECKED) GUICtrlSetOnEvent($frm_install_context, "frm_install_contextClick") Global $frm_install_desktop = GUICtrlCreateCheckbox("Create desktop shortcut", 8, 32, 169, 17) GUICtrlSetState($frm_install_desktop, $GUI_CHECKED) GUICtrlSetOnEvent($frm_install_desktop, "frm_install_desktopClick") Global $frm_install_allusers = GUICtrlCreateCheckbox("All users", 24, 56, 81, 17) GUICtrlSetState($frm_install_allusers, $GUI_CHECKED) GUICtrlSetOnEvent($frm_install_allusers, "frm_install_allusersClick") Global $frm_install_startmenu = GUICtrlCreateCheckbox("Add to Start menu", 8, 80, 129, 17) GUICtrlSetState($frm_install_startmenu, $GUI_CHECKED) GUICtrlSetOnEvent($frm_install_startmenu, "frm_install_startmenuClick") Global $frm_install_OK = GUICtrlCreateButton("OK", 8, 104, 75, 25, $WS_GROUP) GUICtrlSetOnEvent($frm_install_OK, "frm_install_OKClick") Global $frm_install_Cancel = GUICtrlCreateButton("Cancel", 96, 104, 75, 25, $WS_GROUP) GUICtrlSetOnEvent($frm_install_Cancel, "frm_install_CancelClick") GUISetState(@SW_SHOW) While $frm_install_loop Sleep(100) WEnd Func frm_install_allusersClick() EndFunc ;==>frm_install_allusersClick Func frm_install_CancelClick() Exit EndFunc ;==>frm_install_CancelClick Func frm_install_contextClick() EndFunc ;==>frm_install_contextClick Func frm_install_desktopClick() EndFunc ;==>frm_install_desktopClick Func frm_install_OKClick() $frm_install_loop = False EndFunc ;==>frm_install_OKClick Func frm_install_startmenuClick() EndFunc ;==>frm_install_startmenuClick Func frm_installClose() frm_install_CancelClick() EndFunc ;==>frm_installClose Func frm_installMinimize() EndFunc ;==>frm_installMinimize Func frm_installRestore() EndFunc ;==>frm_installRestore If Not DirCreate($installpath) Then MsgBox(0, "Install Error", "Cannot create " & @CRLF & $installpath) If Not DirCreate($datapath) Then MsgBox(0, "Install Error", "Cannot create " & @CRLF & $datapath) DirCreate($datapath & "profiles") DirCreate($datapath & "templates\AU3-general\include") DirCreate($datapath & "templates\AU3-Sqlite\include") If @OSArch = "X64" Then FileInstall("MyProjectFolder64.exe", $installpath & "MyProjectFolder.exe", 1) Else FileInstall("MyProjectFolder.exe", $installpath & "MyProjectFolder.exe", 1) EndIf FileInstall("icons\MyProjectFolder.ico", $installpath & "MyProjectFolder.ico", 0) FileInstall("icons\MyAU3Project.ico", $installpath & "MyAU3Project.ico", 0) FileInstall("uninstall.exe", $installpath & "uninstall.exe", 1) FileInstall("profiles\sample.ini", $datapath & "profiles\sample.ini", 0) FileInstall("templates\AU3-general\template.ini", $datapath & "templates\AU3-general\template.ini", 0) FileInstall("templates\AU3-general\include\__nameshort__.au3", $datapath & "templates\AU3-general\include\__nameshort__.au3", 0) FileInstall("templates\AU3-general\include\__nameshort__.ico", $datapath & "templates\AU3-general\include\__nameshort__.ico", 0) FileInstall("templates\AU3-general\include\config.au3", $datapath & "templates\AU3-general\include\config.au3", 0) FileInstall("templates\AU3-general\include\Desktop.ini", $datapath & "templates\AU3-general\include\Desktop.ini", 0) FileInstall("templates\AU3-Sqlite\template.ini", $datapath & "templates\AU3-Sqlite\template.ini", 0) FileInstall("templates\AU3-Sqlite\include\__nameshort__.au3", $datapath & "templates\AU3-Sqlite\include\__nameshort__.au3", 0) FileInstall("templates\AU3-Sqlite\include\__nameshort__.ico", $datapath & "templates\AU3-Sqlite\include\__nameshort__.ico", 0) FileInstall("templates\AU3-Sqlite\include\config.au3", $datapath & "templates\AU3-Sqlite\include\config.au3", 0) FileInstall("templates\AU3-Sqlite\include\Desktop.ini", $datapath & "templates\AU3-Sqlite\include\Desktop.ini", 0) FileSetAttrib($datapath & "templates\AU3-general\include\Desktop.ini", "+sh") FileSetAttrib($datapath & "templates\AU3-Sqlite\include\Desktop.ini", "+sh") If GUICtrlRead($frm_install_startmenu) = $GUI_CHECKED Then DirCreate(@ProgramsCommonDir & "\MyProjectFolder") FileCreateShortcut($installpath & "MyProjectFolder.exe", @ProgramsCommonDir & "\MyProjectFolder\New MyProject Folder.lnk") FileCreateShortcut($installpath & "uninstall.exe", @ProgramsCommonDir & "\MyProjectFolder\Uninstall.lnk") EndIf If GUICtrlRead($frm_install_desktop) = $GUI_CHECKED Then If GUICtrlRead($frm_install_allusers) = $GUI_CHECKED Then FileCreateShortcut($installpath & "MyProjectFolder.exe", @DesktopCommonDir & "\New MyProject Folder.lnk") Else FileCreateShortcut($installpath & "MyProjectFolder.exe", @DesktopDir & "\New MyProject Folder.lnk") EndIf EndIf If GUICtrlRead($frm_install_context) = $GUI_CHECKED Then RegWrite('HKEY_CLASSES_ROOT\' & $classname, "", "REG_SZ", $menutext) RegWrite('HKEY_CLASSES_ROOT\' & $classname & '\DefaultIcon', "", "REG_SZ", $installpath & 'MyProjectFolder.ico') RegWrite('HKEY_CLASSES_ROOT\' & $classname & '\Shell', "", "REG_SZ", 'Open') RegWrite('HKEY_CLASSES_ROOT\' & $classname & '\Shell\Open', "", "REG_SZ", 'Open') RegWrite('HKEY_CLASSES_ROOT\' & $classname & '\Shell\Open\Command', "", "REG_SZ", 'notepad "%1"') RegWrite('HKEY_CLASSES_ROOT\' & $extension, 'PerceivedType', "REG_SZ", 'text') RegWrite('HKEY_CLASSES_ROOT\' & $extension, "", "REG_SZ", $classname) RegWrite('HKEY_CLASSES_ROOT\' & $extension & '\PersistentHandler', "", "REG_SZ", '{5e941d80-bf96-11cd-b579-08002b30bfeb}') RegWrite('HKEY_CLASSES_ROOT\' & $extension & '\ShellNew', 'Command', "REG_SZ", '"' & $installpath & 'MyProjectFolder.exe" "%1"') MsgBox(64, "MyAU3Project Installer", "It is recomended that you restart your PC to complete the installation process.") EndIf Exit
uninstall.au3
Spoiler
AutoIt
#region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=icons\uninstall.ico #AutoIt3Wrapper_Outfile=uninstall.exe #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_Res_Description=Uninstalls the MyProjectF older utility #AutoIt3Wrapper_Res_Fileversion=1.0.0.8 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Res_LegalCopyright=Copyright 2009, David (willichan) Williams #AutoIt3Wrapper_Res_Language=1033 #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator #AutoIt3Wrapper_AU3Check_Stop_OnWarning=y #AutoIt3Wrapper_Run_Tidy=y #AutoIt3Wrapper_Run_Obfuscator=y #Obfuscator_Parameters=/striponly #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** Global Const $installpath = @ProgramFilesDir & "\MyProjectFolder\" Global Const $datapath = @AppDataCommonDir & "\MyProjectFolder\" Global Const $extension = ".mypf" Global Const $classname = "MyProjectFolder" RegDelete('HKEY_CLASSES_ROOT\' & $extension) RegDelete('HKEY_CLASSES_ROOT\' & $classname) FileSetAttrib($datapath & "templates\AU3-general\include\Desktop.ini", "-rsh") FileSetAttrib($datapath & "templates\AU3-Sqlite\include\Desktop.ini", "-rsh") FileDelete($installpath & "MyProjectFolder.exe") FileDelete($installpath & "MyProjectFolder.ico") FileDelete($installpath & "MyAU3Project.ico") FileDelete($installpath & "uninstall.exe") FileDelete($datapath & "profiles\sample.ini") FileDelete($datapath & "templates\AU3-general\template.ini") FileDelete($datapath & "templates\AU3-general\include\__nameshort__.au3") FileDelete($datapath & "templates\AU3-general\include\__nameshort__.ico") FileDelete($datapath & "templates\AU3-general\include\config.au3") FileDelete($datapath & "templates\AU3-general\include\Desktop.ini") FileDelete($datapath & "templates\AU3-Sqlite\template.ini") FileDelete($datapath & "templates\AU3-Sqlite\include\__nameshort__.au3") FileDelete($datapath & "templates\AU3-Sqlite\include\__nameshort__.ico") FileDelete($datapath & "templates\AU3-Sqlite\include\config.au3") FileDelete($datapath & "templates\AU3-Sqlite\include\Desktop.ini") DirRemove($installpath, 1) DirRemove($datapath, 1) FileDelete(@ProgramsCommonDir & "\MyProjectFolder\New MyProject Folder.lnk") FileDelete(@ProgramsCommonDir & "\MyProjectFolder\Uninstall.lnk") FileDelete(@DesktopCommonDir & "\New MyProject Folder.lnk") FileDelete(@DesktopDir & "\New MyProject Folder.lnk") DirRemove(@ProgramsCommonDir & "\MyProjectFolder") MsgBox(64, "MyProjectFolder Uninstaller", "It is recomended that you restart your PC to complete the uninstallation process.") Exit
---------- Extra Templates ----------
HTML Book - Added Nov. 11, 2010
HTML Book 2 - Added Sep. 10, 2011
---------- Changelog ----------
November 9, 2010 -- New version uploaded to server fixes a minor bug where template sub-folders are not created.
December 20, 2010 -- Source posted below (post #7)
January 26, 2011 -- Minor aesthetic update to alter field focus based on how script is launched.
September 10, 2011 -- Added ability to execute an external program as part of the template launch. (Sep. 10, 2011 or later version of utility)
April 20, 2010 -- Fully Windows 7 compatible (32bit and 64 bit)
Edited by willichan, 21 April 2012 - 05:25 AM.






