Jump to content



Photo

New Project Folder


  • Please log in to reply
12 replies to this topic

#1 willichan

willichan

    Old Geek

  • Active Members
  • PipPipPipPipPipPip
  • 417 posts

Posted 07 October 2010 - 08:09 PM

This evolved from my AU3Project utility.
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


install.au3
Spoiler


uninstall.au3
Spoiler


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








#2 willichan

willichan

    Old Geek

  • Active Members
  • PipPipPipPipPipPip
  • 417 posts

Posted 01 November 2010 - 05:37 PM

Here is an extra template to use with the utility. I use it for creating online HTML books. Just unzip it into the "%ProgramFiles%\MyProjectFolder\templates" folder.

HTML-Book template

#3 Steevegl

Steevegl

    Seeker

  • Normal Members
  • 3 posts

Posted 16 December 2010 - 07:16 PM

Tested on Windows 7 64bits

Install fail

Exec install.exe - OK
Got UI, keep all checked, clicked OK button - OK
Got warning to reboot my PC, clicked OK - OK

Rebooted my computer... nothing nowhere. It's not installed at all.

#4 shanet

shanet

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 313 posts

Posted 16 December 2010 - 07:29 PM

@Steevegl Did you install as an administrator?
My code does not have bugs! It just develops random features.My ProjectsPure randomness
  • Small Minds.......................................................................................................Simple progress bar that changes direction at either sides.
  • ChristmasIt AutoIt Christmas Theme..........................................................I WAS BOOOORED!
  • DriveToy..............................................................................................................Simple joke script. Trick your friends into thinking their computer drive is haywire!
In Development
  • Your Background Task Organiser
  • AInstall Second Generation
BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm

#5 willichan

willichan

    Old Geek

  • Active Members
  • PipPipPipPipPipPip
  • 417 posts

Posted 17 December 2010 - 03:53 PM

Tested on Windows 7 64bits

Install fail

:x
I'll have to look into Win7. I understand 'Program Files' is handled differently. I would not be surprised to know that the context menus are different as well.
I am getting a Win7 Ultimate system set up. I'll put out a new version as soon as I get it working right on that system.

#6 Steevegl

Steevegl

    Seeker

  • Normal Members
  • 3 posts

Posted 20 December 2010 - 02:56 PM

Should be nice if you could give the source. It's probably not a big bug, but I can't figure out myself. :x

BTW, I been able to try the old version by compiling the source myself, and I have a suggestion if it doesn't include in this version:

  • A way to split the source and a the build folder. I'm still surprise to not see it as a default function.


#7 willichan

willichan

    Old Geek

  • Active Members
  • PipPipPipPipPipPip
  • 417 posts

Posted 20 December 2010 - 03:52 PM

Should be nice if you could give the source.

No objections here. I always intended to after cleaning the code up a bit. I just haven't had the time to put on it yet.
Still needs a little more cleanup, but here it is. The installer is probably the piece that is not working with 64-bit.
This is pretty much a full rewrite. I didn't like how clunky the other one was. It was nice for what I needed when I wrote it, but it wasn't much worth trying to fix.

The templates can be pulled from the download above.

MyProjectFolder.au3
AutoIt         
#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 = StringLeft(@ScriptName, StringInStr(@ScriptName, ".", 0, -1) - 1) Global Const $IniFile = @ScriptDir & "\" & $MyName & ".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, $MyName & " Warning", "The following fields must have valid entries:" & $Invalid)     Return False EndFunc   ;==>_frm_main_ValidEntries Func _GetProfiles()     Local $search, $file     Local $found = ""     $search = FileFindFirstFile(@ScriptDir & "\profiles\*.ini")     If $search = -1 Then         Return ""     EndIf     While 1         $file = FileFindNextFile($search)         If @error Then ExitLoop         If StringLower(IniRead(@ScriptDir & "\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(@ScriptDir & "\templates\*.*")     If $search = -1 Then         Return ""     EndIf     While 1         $file = FileFindNextFile($search)         If @error Then ExitLoop         If StringLower(IniRead(@ScriptDir & "\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(@ScriptDir & "\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(@ScriptDir & "\templates\" & StringStripWS(GUICtrlRead($frm_main_template), 3) & "\template.ini", "files")     If @error Then         MsgBox(8192 + 16, $MyName & " Error", "Unable to read " & @ScriptDir & "\templates\" & StringStripWS(GUICtrlRead($frm_main_template), 3) & "\template.ini" & @CRLF & "Template may be corrupt")         Exit 1     EndIf     $delimiter = IniRead(@ScriptDir & "\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(@ScriptDir & "\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(@ScriptDir & "\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(@ScriptDir & "\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"), @ScriptDir & "\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
AutoIt         
Global Const $installpath = @ProgramFilesDir & "\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) If Not IsAdmin() Then     MsgBox(0, "MyProjectFolder Installer", "You must have administrator rights to install this utility.")     Exit EndIf 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 DirCreate($installpath & "profiles") DirCreate($installpath & "templates\AU3-general\include") DirCreate($installpath & "templates\AU3-Sqlite\include") FileInstall("MyProjectFolder.exe", $installpath & "MyProjectFolder.exe", 1) 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", $installpath & "profiles\sample.ini", 0) FileInstall("templates\AU3-general\template.ini", $installpath & "templates\AU3-general\template.ini", 0) FileInstall("templates\AU3-general\include\__nameshort__.au3", $installpath & "templates\AU3-general\include\__nameshort__.au3", 0) FileInstall("templates\AU3-general\include\__nameshort__.ico", $installpath & "templates\AU3-general\include\__nameshort__.ico", 0) FileInstall("templates\AU3-general\include\config.au3", $installpath & "templates\AU3-general\include\config.au3", 0) FileInstall("templates\AU3-general\include\Desktop.ini", $installpath & "templates\AU3-general\include\Desktop.ini", 0) FileInstall("templates\AU3-Sqlite\template.ini", $installpath & "templates\AU3-Sqlite\template.ini", 0) FileInstall("templates\AU3-Sqlite\include\__nameshort__.au3", $installpath & "templates\AU3-Sqlite\include\__nameshort__.au3", 0) FileInstall("templates\AU3-Sqlite\include\__nameshort__.ico", $installpath & "templates\AU3-Sqlite\include\__nameshort__.ico", 0) FileInstall("templates\AU3-Sqlite\include\config.au3", $installpath & "templates\AU3-Sqlite\include\config.au3", 0) FileInstall("templates\AU3-Sqlite\include\Desktop.ini", $installpath & "templates\AU3-Sqlite\include\Desktop.ini", 0) FileSetAttrib($installpath & "templates\AU3-general\include\Desktop.ini", "+sh") FileSetAttrib($installpath & "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


---------- Edit ----------
12/21/2010 - Added admin rights detection to the installer

Edited by willichan, 26 January 2011 - 04:55 PM.


#8 Steevegl

Steevegl

    Seeker

  • Normal Members
  • 3 posts

Posted 21 December 2010 - 02:36 AM

shanet was right, the administrator right is needed. I thought I tried it, seems not.

BTW your installer not ask for administrator right and don't do error if I don't have the right

Seems you don't use AutoIt Wrapper, you could easy fix it with that
#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator


Cheers

#9 willichan

willichan

    Old Geek

  • Active Members
  • PipPipPipPipPipPip
  • 417 posts

Posted 21 December 2010 - 03:34 PM

BTW your installer not ask for administrator right and don't do error if I don't have the right


I have added admin rights checking to the installer above. That is one of those cleanups I never got around to. :x

Seems you don't use AutoIt Wrapper, you could easy fix it with that


I do use the wrapper, but I usually strip that out before posting code. I tend to avoid putting anything that affects functionality as compiler directives. Where ever possible, I try to keep that within the code.
I use the wrapper more for things like version info, custom icons, tidy, obfuscator's /striponly, etc...

#10 lpxx

lpxx

    Seeker

  • Normal Members
  • 3 posts

Posted 22 December 2010 - 07:51 AM

nice script thanks

#11 willichan

willichan

    Old Geek

  • Active Members
  • PipPipPipPipPipPip
  • 417 posts

Posted 26 January 2011 - 04:57 PM

A purely aesthetic update. If run directly (from start menu) focus goes to the path field. Otherwise, focus goes to the long name field.

#12 willichan

willichan

    Old Geek

  • Active Members
  • PipPipPipPipPipPip
  • 417 posts

Posted 10 September 2011 - 07:08 PM

Added another template available for download.
HTML-Book2 semi-automates the creation of the Chapter list and links. I changed over to this template when I was making HTML versions of books downloaded from Project Gutenberg. I have created an at-home online library for my kids to have access to. I needed to not only make the texts look nicer and be easier to read, but I also needed to have them in a format that could be more easily converted to read on Palm, iPod, etc. This template has made that work much easier.

Please see the original post above for the download link.

---- Edit ----
You will also need to update to the version of this utility that was also uploaded today. It adds support for executing an external file as part of the template folder creation process.

Edited by willichan, 10 September 2011 - 07:17 PM.


#13 willichan

willichan

    Old Geek

  • Active Members
  • PipPipPipPipPipPip
  • 417 posts

Posted 21 April 2012 - 05:35 AM

Script is now fully Windows 7 (32bit and 64bit) compatible. See the first post for current code.
I still want to put the uninstaller in the add/remove programs screen, but I am being kind of lazy lately.

This version moves templates and profiles to a new location to accomodate the Windows 7 model.
Templates are in @AppDataCommonDir & "MyProjectFoldertemplates"
Profiles are in @AppDataCommonDir & "MyProjectFolderprofiles"

I recommend backing up your template and profile folders, and uninstalling the old version before installing this one, then restore your folders to the new locations.
You do not have to, but the files in the old location will not be used, and will just consume disk space. Once you install the newer version, uninstall will no longer clean-up the old location.

Edited by willichan, 21 April 2012 - 05:36 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users