Jump to content

Variables in FileInstall


Recommended Posts

Hi, any way i can use variables and or macros with file install? I think it would make some operations simpler.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • Developers

Which part of the helpfile is in your mind unclear or which part of fileinstall would you like to change .... and why?

Jos

ps...moved to supprt  

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I made a kludge-y workaround for this once but it has the prerequisite that your script(s) are built from another script. You can't use F7 in SciTE and have this work (unless you prestage the below workaround).

In all honesty I stopped using this method because I don't use FileInstall() for too many files but it's idea is something like:

1) Use a script to create separate include files for each FileInstall function to be used in a script.
2) Run the include creation script before you compile your main file(s) to update the include files.
3) Compile your main files that use the includes.

$s_hack = @ScriptDir & ".\devcon.exe"

$h_file = FileOpen(@ScriptDir & "\FileInstallHackInclude.au3", 2)
FileWriteLine($h_file, 'FileInstall("' & $s_hack & '","' & @ScriptDir & '\Test.bmp"' & ', 1)')
FileClose($h_file)

 

Always carry a towel.

Link to comment
Share on other sites

@Jos: I suppose my post should have been:

"Is it possible to make variables and macros (other than just @ScriptFullPath) work in the future, for fileinstall?"

"...variables, calculations and function calls do not get resolved until the script itself is running, long after compiling..."

Guess i don't understand what this means.

During compile autoit could deal with the variables and macros, and when compiled,

the exe could deal with it too as soon as it's running, i dont see the issue.

Why is one macro available and none other?

@ModemJunki: That is interesting. Thanks.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • Developers
7 hours ago, careca said:

During compile autoit could deal with the variables and macros, and when compiled,

At Compilation time the source is not ran and the FIleInstall() statement first parameter value is retrieved to determine the location of the file to be included in the PE header.
I really don't see how that could ever be a Variable or a Macro except the one supported, as the script obviously is not being ran at compilation time.

Jos

 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

@careca I think you are experiencing the X Y problem... You want to do X but you are asking about Y which can help you do X, let us know what X is so we can directly help you with it.

You cannot use expressions/variables in the first parameters, but you can use relative paths that are relative to the current script :).

; Example
FileInstall("config.ini", @ScriptDir)

 

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

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

i second that. you may want to share some details on what you are trying to accomplish and how you think variables in FileInstall() might help, so we may suggest a more adequate solution.

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

Consider something like this:

Local $InstallDir = @LocalAppDataDir & '\123'
FileInstall(@ScriptName, $InstallDir & "\"&@ScriptName, 1)

 

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • Developers

Well, as stated, the aut2exe program does not run the script but merely encode it and pack it with the runtime module, so there is no way it can know the value of $installdir.
I honestly still fail to understand how this is needed anyways.... but that could be me. :)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

As this is leading nowhere and it's never going to happen, we can just leave it alone.

Thanks all for the help.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • Developers

You make it sound like we are unwilling to listen and I don't see any effort from your side to try and understand the process or even explain why it would be needed anyways.
Why is it people think they can just post an idea and stick to their idea without even showing any effort to think how that could work in the current process?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Im sorry if that was the idea that got through, i got the idea, you explained it clearly and i thank you for that.

The example i posted shows a situation where one could include whatever the script name is,

in the compiled exe, without having to explicitly write it as a string. I would find this useful and pratical.

You also showed clearly that what i would like is impossible to attain, so i don't see any need to continue along this path.

 

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

@careca I see your point, I don't see why @ScriptName cannot be supported if @ScriptFullPath already is. But you can easily work around this by using @ScriptFullPath in the first parameter and @ScriptName in the second parameters since it does allow variable expressions :)

Local $InstallDir = @LocalAppDataDir & '\123'
FileInstall(@ScriptFullPath, $InstallDir & "\"&@ScriptName, 1)

 

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

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...