emendelson Posted December 18, 2022 Posted December 18, 2022 I use two copies of the same script to compile the script under two different names. The scripts perform different actions depending on the filename of the script, and so it's easy for me to compile one copy of the script and then make a copy of the compiled exe under another name. However, if I do this, both copies of the exe have the same text in the Description and Comment fields. Is it possible to change the contents of the Description and Comment fields according to a variable in the script that gets set differently depending on @Scriptname? That way, I could simply make a copy of the script under a different name and compile both scripts, and the compiled exes would have different Description and Comment fields. This probably isn't possible, but if it is possible, I'll be grateful to learn how.
ioa747 Posted December 18, 2022 Posted December 18, 2022 (edited) take a idea .. or that is enough? Switch @scriptName Case "scriptName1.au3" ; .exe if compiled GUICtrlSetData ( $Description, "Description1" ) GUICtrlSetData ( $Comment, "Comment1" ) actions1() Case "scriptName2.au3" ; .exe if compiled GUICtrlSetData ( $Description, "Description2" ) GUICtrlSetData ( $Comment, "Comment2" ) actions2() EndSwitch Edited December 18, 2022 by ioa747 I know that I know nothing
emendelson Posted December 19, 2022 Author Posted December 19, 2022 Thank you for these suggestions! Unfortunately, I can't make them work in the header part of the file that looks like this. You'll see that I tried the commented lines, but they didn't have any effect. Probably I'm missing something obvious - a command to run before compiling - or this simply isn't possible: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=PrintFilePrinter.ico ; If @ScriptName = "PrintFilePrinter.au3" Then #AutoIt3Wrapper_Res_Comment=PrintFilePrinter #AutoIt3Wrapper_Res_Description=PrintFilePrinter ; Else ; #AutoIt3Wrapper_Res_Comment=PDFWatchPrint ; #AutoIt3Wrapper_Res_Description=PDFWatchPrint ; EndIf #AutoIt3Wrapper_Res_Fileversion=1.0.0.98 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Run_After=d:\dropbox\signfilesem.exe "%out%" #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
Developers Jos Posted December 19, 2022 Developers Posted December 19, 2022 (edited) The description is stored in the PE header of the program, so it can't be dynamically updated at script runtime, when that is what you want. Making a copy and then updating the PE header of the copy is always possible, since that is basically what AutoIt3Wrapper does. Edited December 19, 2022 by 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.
ioa747 Posted December 19, 2022 Posted December 19, 2022 8 minutes ago, emendelson said: Thank you for these suggestions! Unfortunately, I can't make them work in the header part of the file that looks like this. You'll see that I tried the commented lines, but they didn't have any effect. Probably I'm missing something obvious - a command to run before compiling - or this simply isn't possible: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=PrintFilePrinter.ico ; If @ScriptName = "PrintFilePrinter.au3" Then #AutoIt3Wrapper_Res_Comment=PrintFilePrinter #AutoIt3Wrapper_Res_Description=PrintFilePrinter ; Else ; #AutoIt3Wrapper_Res_Comment=PDFWatchPrint ; #AutoIt3Wrapper_Res_Description=PDFWatchPrint ; EndIf #AutoIt3Wrapper_Res_Fileversion=1.0.0.98 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Run_After=d:\dropbox\signfilesem.exe "%out%" #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Oh, so that Description & Comment, you mean Why do you mix AutoIt3Wrapper directives section with your script? take a look to https://www.autoitscript.com/wiki/SciTE4AutoIt3#AutoIt3Wrapper The description is static so that how your program knows which file you will run? I thought you have a textbox with the Description & Comment in your program I know that I know nothing
Solution emendelson Posted December 19, 2022 Author Solution Posted December 19, 2022 Thank you! Understood. I should have been more clear about what I was asking about. I already have the equivalent of a Switch command in my script to change MsgBox titles, etc. - I was only hoping for something that's obviously impossible: changing the AutoIt3Wrapper directives dynamically. Thank you again, and apologies for time-wasting.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now