elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Entrar al Canal Oficial Telegram de elhacker.net


  Mostrar Mensajes
Páginas: 1 ... 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 [922] 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 ... 1236
9211  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 18 Abril 2013, 05:24 am
· Modificar la prioridad de un proceso, por el nombre.

Código
  1. #Region " Set Process Priority By Name "
  2.  
  3.    ' [ Set Process Priority By Name Function ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    ' Set_Process_Priority_By_Name("notepad.exe", ProcessPriorityClass.RealTime)
  9.    ' Set_Process_Priority_By_Name("notepad", ProcessPriorityClass.Idle, False)
  10.  
  11.    Private Function Set_Process_Priority_By_Name(ByVal ProcessName As String, _
  12.                                      ByVal Priority As ProcessPriorityClass, _
  13.                                      Optional ByVal OnlyFirstFound As Boolean = True
  14.                                    ) As Boolean
  15.        Try
  16.            If ProcessName.ToLower.EndsWith(".exe") Then ProcessName = ProcessName.Substring(0, ProcessName.Length - 4)
  17.  
  18.            For Each Proc As Process In System.Diagnostics.Process.GetProcessesByName(ProcessName)
  19.                Proc.PriorityClass = Priority
  20.                If OnlyFirstFound Then Exit For
  21.            Next
  22.  
  23.            Return True
  24.  
  25.        Catch ex As Exception
  26.            ' Return False
  27.            Throw New Exception(ex.Message)
  28.        End Try
  29.  
  30.    End Function
  31.  
  32. #End Region





· Modificar la prioridad de un proceso, por el handle y usando APIS.

Código
  1. #Region " Set Process Priority By Handle "
  2.  
  3.    ' [ Set Process Priority By Handle Function ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    ' Set_Process_Priority_By_Handle(Process.GetCurrentProcess().Handle, Process_Priority.RealTime)
  9.    ' Set_Process_Priority_By_Handle(33033, Process_Priority.Idle)
  10.  
  11.    Private Declare Function GetPriorityClass Lib "kernel32" (ByVal hProcess As Long) As Long
  12.    Private Declare Function SetPriorityClass Lib "kernel32" (ByVal hProcess As Long, ByVal dwPriorityClass As Long) As Long
  13.  
  14.    Public Enum Process_Priority As Int32
  15.        RealTime = 256
  16.        High = 128
  17.        Above_Normal = 32768
  18.        Normal = 32
  19.        Below_Normal = 16384
  20.        Low = 64
  21.    End Enum
  22.  
  23.    Private Function Set_Process_Priority_By_Handle(ByVal Process_Handle As IntPtr, _
  24.                                                    ByVal Process_Priority As Process_Priority) As Boolean
  25.  
  26.        SetPriorityClass(Process_Handle, Process_Priority)
  27.        If GetPriorityClass(Process_Handle) = Process_Priority Then _
  28.             Return True _
  29.        Else Return False ' Return false if priority can't be changed 'cause user permissions.
  30.  
  31.    End Function
  32.  
  33. #End Region





· modificar la prioridad del Thread actual:

Código
  1. #Region " Set Current Thread Priority "
  2.  
  3.    ' [ Set Current Thread Priority Function ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    ' Set_Current_Thread_Priority(Threading.ThreadPriority.AboveNormal)
  9.    ' MsgBox(Set_Current_Thread_Priority(Threading.ThreadPriority.Highest))
  10.  
  11.    Public Shared Function Set_Current_Thread_Priority(ByVal Thread_Priority As Threading.ThreadPriority) As Boolean
  12.        Try
  13.            Threading.Thread.CurrentThread.Priority = Thread_Priority
  14.            Return True
  15.        Catch ex As Exception
  16.            ' Return False
  17.            Throw New Exception(ex.Message)
  18.        End Try
  19.  
  20.    End Function
  21.  
  22. #End Region



9212  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 17 Abril 2013, 21:28 pm
· Comprimir con DotNetZip


Código
  1. #Region " DotNetZip Compress "
  2.  
  3.    ' [ DotNetZip Compress Function ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Instructions :
  8.    ' 1. Add a reference to "Ionic.Zip.dll".
  9.    ' 2. Use the code below.
  10.    '
  11.    ' Examples:
  12.    ' DotNetZip_Compress("C:\File.txt")
  13.    ' DotNetZip_Compress("C:\Folder")
  14.    ' DotNetZip_Compress("C:\Folder", "C:\Folder\Test.zip", , CompressionLevel.BestCompression, "Password", EncryptionAlgorithm.WinZipAes256)
  15.  
  16.    Imports Ionic.Zip
  17.    Imports Ionic.Zlib
  18.  
  19.    Private Function DotNetZip_Compress(ByVal Input_DirOrFile As String, _
  20.                                      Optional ByVal OutputFileName As String = Nothing, _
  21.                                      Optional ByVal CompressionMethod As CompressionMethod = CompressionMethod.None, _
  22.                                      Optional ByVal CompressionLevel As CompressionLevel = CompressionLevel.Default, _
  23.                                      Optional ByVal Password As String = Nothing, _
  24.                                      Optional ByVal Encrypt_Password As EncryptionAlgorithm = EncryptionAlgorithm.None _
  25.                                    ) As Boolean
  26.        Try
  27.            ' Create compressor
  28.            Dim Compressor As ZipFile = New ZipFile
  29.  
  30.            ' Set compression parameters
  31.            Compressor.CompressionLevel = CompressionLevel ' Archiving compression level.
  32.            Compressor.CompressionMethod = CompressionMethod ' Compression method
  33.            Compressor.Password = Password ' Zip Password
  34.            Compressor.TempFileFolder = System.IO.Path.GetTempPath() ' Temp folder for operations
  35.  
  36.            If Password Is Nothing AndAlso Not Encrypt_Password = EncryptionAlgorithm.None Then _
  37.                 Compressor.Encryption = EncryptionAlgorithm.None _
  38.            Else Compressor.Encryption = Encrypt_Password ' Encryption for Zip password.
  39.  
  40.            ' Add Progress Handler
  41.            ' AddHandler Compressor.SaveProgress, AddressOf DotNetZip_Compress_Progress
  42.  
  43.            ' Removes the end slash ("\") if is given for a directory.
  44.            If Input_DirOrFile.EndsWith("\") Then Input_DirOrFile = Input_DirOrFile.Substring(0, Input_DirOrFile.Length - 1)
  45.  
  46.            ' Generate the OutputFileName if any is given.
  47.            If OutputFileName Is Nothing Then _
  48.                OutputFileName = (My.Computer.FileSystem.GetFileInfo(Input_DirOrFile).DirectoryName & "\" & (Input_DirOrFile.Split("\").Last) & ".zip").Replace("\\", "\")
  49.  
  50.            ' Check if given argument is Dir or File ...then start the compression
  51.            If IO.Directory.Exists(Input_DirOrFile) Then ' It's a Dir
  52.                Compressor.AddDirectory(Input_DirOrFile)
  53.            ElseIf IO.File.Exists(Input_DirOrFile) Then ' It's a File
  54.                Compressor.AddFile(Input_DirOrFile)
  55.            End If
  56.  
  57.            Compressor.Save(OutputFileName)
  58.            Compressor.Dispose()
  59.  
  60.        Catch ex As Exception
  61.            'Return False ' File not compressed
  62.            Throw New Exception(ex.Message)
  63.        End Try
  64.  
  65.        Return True ' File compressed
  66.  
  67.    End Function
  68.  
  69.    'Public Sub DotNetZip_Compress_Progress(ByVal sender As Object, ByVal e As SaveProgressEventArgs)
  70.    '
  71.    '    If e.EventType = ZipProgressEventType.Saving_Started Then
  72.    '        MsgBox("Begin Saving: " & _
  73.    '               e.ArchiveName) ' Destination ZIP filename
  74.    '
  75.    '    ElseIf e.EventType = ZipProgressEventType.Saving_BeforeWriteEntry Then
  76.    '        MsgBox("Writing: " & e.CurrentEntry.FileName & _
  77.    '               " (" & (e.EntriesSaved + 1) & "/" & e.EntriesTotal & ")") ' Input filename to be compressed
  78.    '
  79.    '        ' ProgressBar2.Maximum = e.EntriesTotal   ' Count of total files to compress
  80.    '        ' ProgressBar2.Value = e.EntriesSaved + 1 ' Count of compressed files
  81.    '
  82.    '    ElseIf e.EventType = ZipProgressEventType.Saving_EntryBytesRead Then
  83.    '        ' ProgressBar1.Value = CType((e.BytesTransferred * 100) / e.TotalBytesToTransfer, Integer) ' Total Progress
  84.    '
  85.    '    ElseIf e.EventType = ZipProgressEventType.Saving_Completed Then
  86.    '        MessageBox.Show("Compression Done: " & vbNewLine & _
  87.    '                        e.ArchiveName) ' Compression finished
  88.    '    End If
  89.    '
  90.    'End Sub
  91.  
  92. #End Region





· Crear un SFX con DotNetZip

Código
  1. #Region " DotNetZip Compress SFX "
  2.  
  3.  
  4.    ' [ DotNetZip Compress SFX Function ]
  5.    '
  6.    ' // By Elektro H@cker
  7.    '
  8.    ' Instructions :
  9.    ' 1. Add a reference to "Ionic.Zip.dll".
  10.    ' 2. Use the code below.
  11.    '
  12.    ' Examples:
  13.    ' DotNetZip_Compress_SFX("C:\File.txt")
  14.    ' DotNetZip_Compress_SFX("C:\Folder")
  15.    '
  16.    ' DotNetZip_Compress_SFX( _
  17.    '    "C:\File.txt", "C:\Test.exe", , CompressionLevel.BestCompression, _
  18.    '    "MyPassword", EncryptionAlgorithm.WinZipAes256, , , _
  19.    '    ExtractExistingFileAction.OverwriteSilently, , , , _
  20.    '    System.IO.Path.GetFileName("notepad.exe") _
  21.    ' )
  22.  
  23.  
  24.    Imports Ionic.Zip
  25.    Imports Ionic.Zlib
  26.  
  27.    Private Function DotNetZip_Compress_SFX(ByVal Input_DirOrFile As String, _
  28.                                      Optional ByVal OutputFileName As String = Nothing, _
  29.                                      Optional ByVal CompressionMethod As CompressionMethod = CompressionMethod.None, _
  30.                                      Optional ByVal CompressionLevel As CompressionLevel = CompressionLevel.Default, _
  31.                                      Optional ByVal Password As String = Nothing, _
  32.                                      Optional ByVal Encrypt_Password As EncryptionAlgorithm = EncryptionAlgorithm.None, _
  33.                                      Optional ByVal Extraction_Directory As String = ".\", _
  34.                                      Optional ByVal Silent_Extraction As Boolean = False, _
  35.                                      Optional ByVal Overwrite_Files As ExtractExistingFileAction = ExtractExistingFileAction.InvokeExtractProgressEvent, _
  36.                                      Optional ByVal Delete_Extracted_Files_After_Extraction As Boolean = False, _
  37.                                      Optional ByVal Icon As String = Nothing, _
  38.                                      Optional ByVal Window_Title As String = Nothing, _
  39.                                      Optional ByVal Window_Style As SelfExtractorFlavor = SelfExtractorFlavor.WinFormsApplication, _
  40.                                      Optional ByVal Command_Line_Argument As String = Nothing _
  41.                                    ) As Boolean
  42.        Try
  43.            ' Create compressor
  44.            Dim Compressor As ZipFile = New ZipFile
  45.  
  46.            ' Set compression parameters
  47.            Compressor.CompressionLevel = CompressionLevel ' Archiving compression level.
  48.            ' Compression method
  49.            Compressor.Password = Password ' Zip Password
  50.            Compressor.TempFileFolder = System.IO.Path.GetTempPath() ' Temp folder for operations
  51.  
  52.            If Password Is Nothing AndAlso Not Encrypt_Password = EncryptionAlgorithm.None Then
  53.                Compressor.Encryption = EncryptionAlgorithm.None ' No encryption because no password.
  54.                Compressor.CompressionMethod = CompressionMethod ' Set any compression method.
  55.            Else
  56.                Compressor.Encryption = Encrypt_Password ' Set Encryption for Zip password.
  57.                Compressor.CompressionMethod = CompressionMethod.Deflate ' Set deflate method to don't destroy the SFX if AES encryption.
  58.            End If
  59.  
  60.            Dim SFX_Options As New SelfExtractorSaveOptions()
  61.            SFX_Options.DefaultExtractDirectory = Extraction_Directory
  62.            SFX_Options.Quiet = Silent_Extraction
  63.            SFX_Options.ExtractExistingFile = ExtractExistingFileAction.OverwriteSilently
  64.            SFX_Options.RemoveUnpackedFilesAfterExecute = Delete_Extracted_Files_After_Extraction
  65.            SFX_Options.Flavor = Window_Style
  66.            SFX_Options.PostExtractCommandLine = Command_Line_Argument
  67.            If Not Icon Is Nothing Then SFX_Options.IconFile = Icon
  68.            If Not Window_Title Is Nothing Then SFX_Options.SfxExeWindowTitle = Window_Title
  69.  
  70.            ' Add Progress Handler
  71.            ' AddHandler Compressor.SaveProgress, AddressOf DotNetZip_Compress_SFX_Progress
  72.  
  73.            ' Removes the end slash ("\") if is given for a directory.
  74.            If Input_DirOrFile.EndsWith("\") Then Input_DirOrFile = Input_DirOrFile.Substring(0, Input_DirOrFile.Length - 1)
  75.  
  76.            ' Generate the OutputFileName if any is given.
  77.            If OutputFileName Is Nothing Then _
  78.                OutputFileName = (My.Computer.FileSystem.GetFileInfo(Input_DirOrFile).DirectoryName & "\" & (Input_DirOrFile.Split("\").Last) & ".exe").Replace("\\", "\")
  79.  
  80.            ' Check if given argument is Dir or File ...then start the compression
  81.            If IO.Directory.Exists(Input_DirOrFile) Then ' It's a Dir
  82.                Compressor.AddDirectory(Input_DirOrFile)
  83.            ElseIf IO.File.Exists(Input_DirOrFile) Then ' It's a File
  84.                Compressor.AddFile(Input_DirOrFile)
  85.            End If
  86.  
  87.            Compressor.SaveSelfExtractor(OutputFileName, SFX_Options)
  88.            Compressor.Dispose()
  89.  
  90.        Catch ex As Exception
  91.            'Return False ' File not compressed
  92.            Throw New Exception(ex.Message)
  93.        End Try
  94.  
  95.        Return True ' File compressed
  96.  
  97.    End Function
  98.  
  99.    ' Public Sub DotNetZip_Compress_SFX_Progress(ByVal sender As Object, ByVal e As SaveProgressEventArgs)
  100.    '
  101.    '    If e.EventType = ZipProgressEventType.Saving_Started Then
  102.    '        MsgBox("Begin Saving: " & _
  103.    '               e.ArchiveName) ' Destination ZIP filename
  104.    '
  105.    '    ElseIf e.EventType = ZipProgressEventType.Saving_BeforeWriteEntry Then
  106.    '        MsgBox("Writing: " & e.CurrentEntry.FileName & _
  107.    '               " (" & (e.EntriesSaved + 1) & "/" & e.EntriesTotal & ")") ' Input filename to be compressed
  108.    '
  109.    '        ' ProgressBar2.Maximum = e.EntriesTotal   ' Count of total files to compress
  110.    '        ' ProgressBar2.Value = e.EntriesSaved + 1 ' Count of compressed files
  111.    '
  112.    '    ElseIf e.EventType = ZipProgressEventType.Saving_EntryBytesRead Then
  113.    '        ' ProgressBar1.Value = CType((e.BytesTransferred * 100) / e.TotalBytesToTransfer, Integer) ' Total Progress
  114.    '
  115.    '    ElseIf e.EventType = ZipProgressEventType.Saving_Completed Then
  116.    '        MessageBox.Show("Compression Done: " & vbNewLine & _
  117.    '                        e.ArchiveName) ' Compression finished
  118.    '    End If
  119.    '
  120.    ' End Sub
  121.  
  122. #End Region





· Descomprimir con DotNetZip


Código
  1. #Region " DotNetZip Extract "
  2.  
  3.    ' [ DotNetZip Extract Function ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Instructions :
  8.    ' 1. Add a reference to "Ionic.Zip.dll".
  9.    ' 2. Use the code below.
  10.    '
  11.    ' Examples:
  12.    ' DotNetZip_Extract("C:\File.zip")
  13.    ' DotNetZip_Extract("C:\File.zip", "C:\Folder\Test\", , "MyPassword")
  14.  
  15.    Imports Ionic.Zip
  16.    Imports Ionic.Zlib
  17.  
  18.    Dim ZipFileCount As Long = 0
  19.    Dim ExtractedFileCount As Long = 0
  20.  
  21.    Private Function DotNetZip_Extract(ByVal InputFile As String, _
  22.                                       Optional ByVal OutputDir As String = Nothing, _
  23.                                       Optional ByVal Overwrite As ExtractExistingFileAction = ExtractExistingFileAction.DoNotOverwrite, _
  24.                                       Optional ByVal Password As String = "Nothing" _
  25.                                     ) As Boolean
  26.        Try
  27.            ' Create Extractor
  28.            Dim Extractor As ZipFile = ZipFile.Read(InputFile)
  29.  
  30.            ' Set Extractor parameters
  31.            Extractor.Password = Password ' Zip Password
  32.            Extractor.TempFileFolder = System.IO.Path.GetTempPath() ' Temp folder for operations
  33.            Extractor.ZipErrorAction = ZipErrorAction.Throw
  34.  
  35.            ' Specify the output path where the files will be extracted
  36.            If OutputDir Is Nothing Then OutputDir = My.Computer.FileSystem.GetFileInfo(InputFile).DirectoryName
  37.  
  38.            ' Add Progress
  39.            'AddHandler Extractor.ExtractProgress, AddressOf DotNetZip_Extract_Progress ' Progress Handler
  40.            'For Each Entry As ZipEntry In Extractor.Entries : ZipFileCount += 1 : Next ' Total bytes size of Zip
  41.            'ZipFileCount = Extractor.Entries.Count ' Total files inside Zip
  42.  
  43.            ' Start the extraction
  44.            For Each Entry As ZipEntry In Extractor.Entries : Entry.Extract(OutputDir, Overwrite) : Next
  45.  
  46.            ZipFileCount = 0 : ExtractedFileCount = 0 ' Reset vars
  47.            Extractor.Dispose()
  48.            Return True ' File Extracted
  49.  
  50.        Catch ex As Exception
  51.            ' Return False ' File not extracted
  52.            Throw New Exception(ex.Message)
  53.        End Try
  54.  
  55.    End Function
  56.  
  57.    ' Public Sub DotNetZip_Extract_Progress(ByVal sender As Object, ByVal e As ExtractProgressEventArgs)
  58.    '
  59.    '     If e.EventType = ZipProgressEventType.Extracting_BeforeExtractEntry Then
  60.    '         If ExtractedFileCount = 0 Then
  61.    '             MsgBox("Begin Extracting: " & _
  62.    '                     e.ArchiveName) ' Input ZIP filename
  63.    '         End If
  64.    '
  65.    '         ExtractedFileCount += 1
  66.    '         MsgBox("Writing: " & e.CurrentEntry.FileName & _
  67.    '                " (" & (ExtractedFileCount) & "/" & ZipFileCount & ")") ' Output filename uncompressing
  68.    '
  69.    '         ProgressBar1.Maximum = ZipFileCount     ' Count of total files to uncompress
  70.    '         ProgressBar1.Value = ExtractedFileCount ' Count of uncompressed files
  71.    '
  72.    '     ElseIf e.EventType = ZipProgressEventType.Extracting_AfterExtractEntry Then
  73.    '         If ExtractedFileCount = ZipFileCount Then
  74.    '             MessageBox.Show("Extraction Done: " & vbNewLine & _
  75.    '                             e.ArchiveName) ' Uncompression finished
  76.    '         End If
  77.    '     End If
  78.    '
  79.    ' End Sub
  80.  
  81. #End Region
9213  Programación / Scripting / Re: Ayuda co codigo pyhton en: 17 Abril 2013, 20:07 pm
en caso de que lo quieras compilar la herramienta que buscas es py2exe previamente instalado python

Py2Exe es un full-of-errors y comederos de cabeza cuando se utiliza en x64, yo no lo usaría para "compilar" mis scripts aunque me pagasen por ello.

Si la cuestión trata de "compilar", les recomiendo este y ningún otro: http://cx-freeze.sourceforge.net/

...Pero son libres de elegir.

Saludos!
9214  Programación / Scripting / MOVIDO: Robot publicitario en pascal R-WEB [Aporte], (Aumenta tus visitas!) en: 17 Abril 2013, 18:29 pm
El tema ha sido movido a Programación General.
Delphi/Pascal no es un lenguaje interpretado :P.
http://foro.elhacker.net/index.php?topic=388274.0
9215  Programación / Scripting / [APORTE] [Inno Setup] Plantilla para usarla como script por defecto. en: 17 Abril 2013, 13:21 pm
A petición de un usuario aquí tienen la plantilla por defecto que uso para mis instaladores...


Setup.iss

Código
  1. ; = = = = = = = = = = = = = = = = = = =
  2. ; Default Template (by Elektro H@cker) |
  3. ;                                      |
  4. ;            InnoSetup 5.5.3           |
  5. ; = = = = = = = = = = = = = = = = = = =
  6.  
  7. [Setup]
  8.  
  9. ; Info
  10. ; ----
  11. #define Name "Application"
  12. #define Version "1.0"
  13. #define EXE "Application.exe"
  14. AppName={#Name}
  15. AppVersion={#Version}
  16. AppVerName={#Name} {#Version}
  17. AppCopyright=Elektro H@cker
  18. AppPublisher=Elektro H@cker
  19.  
  20. ; Paths
  21. ; -----
  22. DefaultDirName={pf}\{#Name}
  23. DefaultGroupName={#Name}
  24. OutputDir=.\Output\
  25. OutputBaseFilename={#Name}
  26. UninstallDisplayIcon={app}\{#EXE}
  27.  
  28. ; Resources
  29. ; ---------
  30. ;SetupIconFile=Icon.ico
  31. ;WizardImageFile=Icon.bmp
  32. ;WizardSmallImageFile=Icon.bmp
  33. ;InfoBeforeFile=Info.txt
  34.  
  35. ; Compression
  36. ; -----------
  37. Compression=lzma/ultra
  38. InternalCompressLevel=Ultra
  39. SolidCompression=True
  40.  
  41. ; Appearance
  42. ; ----------
  43. AlwaysShowComponentsList=False
  44. DisableDirPage=True
  45. DisableProgramGroupPage=True
  46. DisableReadyPage=True
  47. DisableStartupPrompt=True
  48. FlatComponentsList=False
  49. LanguageDetectionMethod=None
  50. PrivilegesRequired=PowerUser
  51. RestartIfNeededByRun=False
  52. ShowLanguageDialog=NO
  53. ShowTasksTreeLines=True
  54. Uninstallable=True
  55. ArchitecturesAllowed=x86 x64
  56. ;ArchitecturesInstallIn64BitMode=x64
  57.  
  58. [Languages]
  59. Name: spanish; MessagesFile: compiler:Languages\Spanish.isl
  60.  
  61. [Dirs]
  62. ;{sd}                  = C:\
  63. ;{commonappdata}       = C:\ProgramData
  64. ;{sd}\Users\{username} = C:\Users\UserName
  65. ;{userdesktop}         = C:\Users\UserName\Desktop
  66. ;{localappdata}        = C:\Users\UserName\AppData\Local
  67. ;{userappdata}         = C:\Users\UserName\AppData\Roaming
  68. ;{userstartmenu}       = C:\Users\UserName\AppData\Roaming\Microsoft\Windows\Start Menu
  69.  
  70. [Files]
  71. ;Source: {app}\*.*; DestDir: {app}; DestName:; Attribs:; Flags:;
  72. ;Attribs: ReadOnly Hidden System
  73. ;DestName: Example.exe
  74. ;Flags: 32bit 64bit Deleteafterinstall IgnoreVersion NoCompression Onlyifdoesntexist recursesubdirs uninsneveruninstall
  75.  
  76. [Registry]
  77. ;Root: HKCR; Subkey: SystemFileAssociations\.ext\Shell\OPTION; ValueName: Icon; ValueType: String; ValueData: {app}\{#Exe}; Flags: ;
  78. ;Root: HKCR; Subkey: SystemFileAssociations\.ext\Shell\OPTION\Command; ValueType: String; ValueData: """{app}\{#Exe}"" ""%1"""; Flags: ;
  79. ;Flags: uninsdeletevalue uninsdeletekey
  80.  
  81. [Tasks]
  82. ;Name: Identifier; Description: Title; GroupDescription: Group; Flags:;
  83. ;Flags: Unchecked
  84.  
  85. [Run]
  86. ;Filename: "{cmd}"; Parameters: "/C command"; StatusMsg: "Installing..."; Flags: RunHidden WaitUntilTerminated
  87. ;Filename: {app}\{#Exe}; Description: {cm:LaunchProgram,{#Nombre}}; Flags: NoWait PostInstall SkipIfSilent ShellExec Unchecked
  88. ;Flags: 32bit 64bit RunHidden WaitUntilTerminated NoWait PostInstall SkipIfSilent ShellExec Unchecked
  89.  
  90. [Icons]
  91. Name: {userstartmenu}\Programs\{#Name}; Filename: {app}\{#Exe}; Iconfilename: {app}\{#Exe}; WorkingDir: {app}
  92.  
  93. [Code]
  94.  
  95. const
  96.  Custom_Height = 440;
  97.  Custom_ProgressBar_Height = 20;
  98.  Page_Color = clwhite;
  99.  Page_Color_Alternative1 = clblack;
  100.  Page_Color_Alternative2 = clwhite;
  101.  Font_Color = clblack;
  102.  
  103.  
  104. var
  105.  DefaultTop,
  106.  DefaultLeft,
  107.  DefaultHeight,
  108.  DefaultBackTop,
  109.  DefaultNextTop,
  110.  DefaultCancelTop,
  111.  DefaultBevelTop,
  112.  DefaultOuterHeight: Integer;
  113.  
  114.  
  115. procedure InitializeWizard();
  116. begin
  117.  
  118.  DefaultTop := WizardForm.Top;
  119.  DefaultLeft := WizardForm.Left;
  120.  DefaultHeight := WizardForm.Height;
  121.  DefaultBackTop := WizardForm.BackButton.Top;
  122.  DefaultNextTop := WizardForm.NextButton.Top;
  123.  DefaultCancelTop := WizardForm.CancelButton.Top;
  124.  DefaultBevelTop := WizardForm.Bevel.Top;
  125.  DefaultOuterHeight := WizardForm.OuterNotebook.Height;
  126.  
  127.  
  128.  // Pages (Size)
  129.  WizardForm.Height := Custom_Height;
  130.  WizardForm.InnerPage.Height := WizardForm.InnerPage.Height + (Custom_Height - DefaultHeight);
  131.  WizardForm.LicensePage.Height := WizardForm.LicensePage.Height + (Custom_Height - DefaultHeight);
  132.  
  133.  
  134.  // Pages (Color)
  135.  WizardForm.color := Page_Color_Alternative1;
  136.  WizardForm.FinishedPage.Color  := Page_Color;
  137.  WizardForm.InfoAfterPage.Color := Page_Color;
  138.  WizardForm.InfoBeforePage.Color := Page_Color;
  139.  WizardForm.InnerPage.Color := Page_Color;
  140.  WizardForm.InstallingPage.color := Page_Color;
  141.  WizardForm.LicensePage.Color := Page_Color;
  142.  WizardForm.PasswordPage.color := Page_Color;
  143.  WizardForm.PreparingPage.color := Page_Color;
  144.  WizardForm.ReadyPage.Color := Page_Color;
  145.  WizardForm.SelectComponentsPage.Color  := Page_Color;
  146.  WizardForm.SelectDirPage.Color  := Page_Color;
  147.  WizardForm.SelectProgramGroupPage.color := Page_Color;
  148.  WizardForm.SelectTasksPage.color := Page_Color;
  149.  WizardForm.UserInfoPage.color := Page_Color;
  150.  WizardForm.WelcomePage.color := Page_Color;
  151.  
  152.  
  153.  // Controls (Size)
  154.  WizardForm.InfoAfterMemo.Height := (Custom_Height - (DefaultHeight / 2));
  155.  WizardForm.InfoBeforeMemo.Height := (Custom_Height - (DefaultHeight / 2));
  156.  WizardForm.InnerNotebook.Height :=  WizardForm.InnerNotebook.Height + (Custom_Height - DefaultHeight);
  157.  WizardForm.LicenseMemo.Height := WizardForm.LicenseMemo.Height + (Custom_Height - DefaultHeight);
  158.  WizardForm.OuterNotebook.Height := WizardForm.OuterNotebook.Height + (Custom_Height - DefaultHeight);
  159.  WizardForm.ProgressGauge.Height := Custom_ProgressBar_Height
  160.  WizardForm.ReadyMemo.Height := (Custom_Height - (DefaultHeight / 2));
  161.  WizardForm.Taskslist.Height := (Custom_Height - (DefaultHeight / 2));
  162.  WizardForm.WizardBitmapImage.Height := (Custom_Height - (DefaultHeight - DefaultBevelTop));
  163.  WizardForm.WizardBitmapImage2.Height  := (Custom_Height - (DefaultHeight - DefaultBevelTop));
  164.  
  165.  
  166.  // Controls (Location)
  167.  WizardForm.BackButton.Top := DefaultBackTop + (Custom_Height - DefaultHeight);
  168.  WizardForm.Bevel.Top := DefaultBevelTop + (Custom_Height - DefaultHeight);
  169.  WizardForm.CancelButton.Top := DefaultCancelTop + (Custom_Height - DefaultHeight);
  170.  WizardForm.LicenseAcceptedRadio.Top := WizardForm.LicenseAcceptedRadio.Top + (Custom_Height - DefaultHeight);
  171.  WizardForm.LicenseNotAcceptedRadio.Top := WizardForm.LicenseNotAcceptedRadio.Top + (Custom_Height - DefaultHeight);
  172.  WizardForm.NextButton.Top := DefaultNextTop + (Custom_Height - DefaultHeight);
  173.  WizardForm.Top := DefaultTop - (Custom_Height - DefaultHeight) div 2;
  174.  //WizardForm.ProgressGauge.Top := (DefaultHeight / 2)
  175.  
  176.  
  177.  // Controls (Back Color)
  178.  WizardForm.DirEdit.Color  := Page_Color_Alternative2;
  179.  WizardForm.GroupEdit.Color  := Page_Color_Alternative2;
  180.  WizardForm.InfoAfterMemo.Color := Page_Color_Alternative2;
  181.  WizardForm.InfoBeforeMemo.Color := Page_Color_Alternative2;
  182.  WizardForm.LicenseMemo.Color := Page_Color_Alternative2;
  183.  WizardForm.MainPanel.Color := Page_Color;
  184.  WizardForm.PasswordEdit.Color  := Page_Color_Alternative2;
  185.  WizardForm.ReadyMemo.Color := Page_Color_Alternative2;
  186.  WizardForm.Taskslist.Color := Page_Color;
  187.  WizardForm.UserInfoNameEdit.Color  := Page_Color_Alternative2;
  188.  WizardForm.UserInfoOrgEdit.Color  := Page_Color_Alternative2;
  189.  WizardForm.UserInfoSerialEdit.Color  := Page_Color_Alternative2;
  190.  
  191.  
  192.  // Controls (Font Color)
  193.  WizardForm.FinishedHeadingLabel.font.color  := Font_Color;
  194.  WizardForm.InfoafterMemo.font.Color  := Font_Color;
  195.  WizardForm.FinishedLabel.font.color  := Font_Color;
  196.  WizardForm.DirEdit.font.Color  := Page_Color_Alternative1;
  197.  WizardForm.Font.color := Font_Color;
  198.  WizardForm.GroupEdit.font.Color  := Page_Color_Alternative1;
  199.  WizardForm.InfoBeforeMemo.font.Color  := Page_Color_Alternative1;
  200.  WizardForm.LicenseMemo.font.Color  := Page_Color_Alternative1;
  201.  WizardForm.MainPanel.font.Color := Font_Color;
  202.  WizardForm.PageDescriptionLabel.font.color  := Font_Color;
  203.  WizardForm.PageNameLabel.font.color  := Font_Color;
  204.  WizardForm.PasswordEdit.font.Color  := Page_Color_Alternative1;
  205.  WizardForm.Taskslist.font.Color  := Font_Color;
  206.  WizardForm.UserInfoNameEdit.font.Color  := Page_Color_Alternative1;
  207.  WizardForm.UserInfoOrgEdit.font.Color  := Page_Color_Alternative1;
  208.  WizardForm.UserInfoSerialEdit.font.Color  := Page_Color_Alternative1;
  209.  WizardForm.WelcomeLabel1.font.color  := Font_Color;
  210.  WizardForm.WelcomeLabel2.font.color  := Font_Color;
  211.  WizardForm.ReadyMemo.font.Color := Page_Color_Alternative1;
  212.  
  213. end;


Este es el aspecto por defecto:




Y se puede customizar un poco el aspecto para conseguir algo parecido a esto, sólamente cambiando las variables de la plantilla...

[/code]
9216  Programación / Scripting / Re: Acciones sobre archivos de texto. [Batch] en: 17 Abril 2013, 00:42 am
pero a mi me cuesta mucho.

De lo que se trata es de aprender poco a poco, con ejemplos pero sin que te lo den todo hecho, yo ya te dí casi todo hecho, solo hay que colocar cada cosa en su sitio :P.

Intenta hacerlo y si aún no lo has conseguido postea el código que llevas y te lo corregiré en un minuti momento.

Un saludo.
9217  Programación / Programación General / Re: Modificar idiomas de .exe en: 17 Abril 2013, 00:25 am
aquí tienes un pequeñísimo ejemplo:

http://foro.elhacker.net/scripting/deshabilitar_pestana_procesos_del_administardor_de_tareas-t378796.0.html;msg1811891#msg1811891



Saludos
9218  Programación / Scripting / Re: Acciones sobre archivos de texto. [Batch] en: 17 Abril 2013, 00:18 am
Lo que quiero es que en la ventana cmd pueda escribir el texto a añadir a todas las lineas del texto.
El que tu me pones la ventana cmd me pide el nombre del archivo de texto.

La idea es que partiendo del archivo frutero.txt (u otro nombre) la ventana cmd pida el texto a añadir a las lineas de ese archivo de texto.

Fíjate en el código, puedes pedir el texto a introducir exáctamente de la misma manera que se puede pedir el archivo de texto en el script que te he puesto de ejemplo. Te quise poner un ejemplo de las dos maneras.

Código:
Set /P /?

Citar
El modificador /P permite establecer el valor de una variable para una línea
de entrada escrita por el usuario. Muestra la cadena del símbolo del sistema
antes de leer la línea de entrada. La cadena del símbolo del sistema puede
estar vacía.

Saludos!
9219  Informática / Software / Re: [APORTE] MEGA-PACK para iniciarse en VS2012 x64 (Instalador + Recursos + Tools) en: 17 Abril 2013, 00:02 am
¡ Llegó la nueva versión del instalador !

He corregido un error que sufrieron algunas personas con la carpeta de instalación del VS en la version antigua de este instalador...
Además lo he optimizado tanto en el sistema de la instalación de los componentes, como en su desinstalación... ...Y contiene más librerías, más controles, y más snippets!


La instalación completa y la instalación por defecto han sido testeadas en Windows 7 de 32 y 64 Bits, en Windows XP tampoco debería haber problemas.



LO PUEDEN DESCARGAR DE FORMA DIRECTA EN EL COMENTARIO PRINCIPAL DE ESTE HILO.



         
9220  Informática / Software / Re: [APORTE] MEGA-PACK para iniciarse en VS2012 x64 (Instalador + Recursos + Tools) en: 17 Abril 2013, 00:00 am
De nada, eh? xD

Me ha hecho mucha gracia el video, es un tutorial express xD

"...Y después de instalar esto le pinchamos aquí para abrir el .NET, que tarda unas 400 horas en abrirse, pero yo ya lo tenia abierto así que..." X'D

Gracias por el video.

PD: El idioma por defecto de la IDE es Inglés, para poder elegir Español (como comentas en tu tuto) hay que instalar el idioma español para la IDe (Que va incluida en el instalador).
Páginas: 1 ... 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 [922] 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 ... 1236
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines