diff --git a/HTML/01-Introduction.html b/HTML/01-Introduction.html index fb1fae7..08669a7 100644 --- a/HTML/01-Introduction.html +++ b/HTML/01-Introduction.html @@ -170,7 +170,7 @@

Acknowledgements

Footnotes

  1. Perhaps one day you would like it to ship on multiple platforms. Perhaps one day we’ll write that book too. Meanwhile, Microsoft Windows.

    You will however find that whenever possible we keep the code platform independent. If we use platform-dependent utilities we mention it and explain why; we might also mention alternatives available on other platforms.

    -
  2. APLTree is the name of an open-source library that offers robust, tested and well documented solutions to many everyday problems you face when addressing the tasks discussed in this book.

    We will use this library extensively and discuss it in detail. More at the source:
    https://aplteam.github.io/apltree. You can also search for “apltree” on GitHub.

    +
  3. APLTree is the name of an open-source library that offers robust, tested and well documented solutions to many everyday problems you face when addressing the tasks discussed in this book.

    We will use this library extensively and discuss it in detail. More at the source:
    https://github.com/aplteam/apltree/wiki/Members. You can also search for “apltree” on GitHub.

  4. These days seasoned programmers often have strong opinions about whether to use an object-oriented approach or a functional approach, or to mix them both.

    We have seen friendships broken on these issues. In this book we take a mixed approach.

diff --git a/HTML/02-Structure.html b/HTML/02-Structure.html index 2f4f48b..0764043 100644 --- a/HTML/02-Structure.html +++ b/HTML/02-Structure.html @@ -245,7 +245,7 @@

How to organise the code

Information
-

The APLTree library is an open-source project hosted on GitHub. It offers solutions for many every-day problems a Dyalog APL programmer might run into. In the Cookbook we will use many of its members. For details see https://aplteam.github.io/apltree.

+

The APLTree library is an open-source project hosted on GitHub. It offers solutions for many every-day problems a Dyalog APL programmer might run into. In the Cookbook we will use many of its members. For details see https://github.com/aplteam/apltree/wiki.

diff --git a/HTML/03-Packaging.html b/HTML/03-Packaging.html index 5c3fabf..d0716a1 100644 --- a/HTML/03-Packaging.html +++ b/HTML/03-Packaging.html @@ -90,8 +90,17 @@

3. Package MyApp as an executable

Output to the session log

-

In a runtime interpreter or an EXE, there is no APL session, and output to the session which would have been visible in a development system will simply disappear. If we want to see this output, we need to write it to a log file.

-

But how do we find out where we need to make changes? We recommend you think about this from the start, and ensure that all intentional output goes through a log function, or at least use an explicit ⎕← so that output can easily be identified in the source.

+

In a runtime interpreter or an EXE, there is no APL session, and output to the session which would have been visible in a development system will simply disappear.

+ +
+Information +
+

Note that output assigned to or does not stop the runtime executable.

+

However, when the result of a function is neither consumed by another function nor assigned to a variable then you will see the message “This Dyalog APL runtime application has attempted to use the APL session and therefore be closed.”, and that will be the end of it.

+
+
+ +

If we want to see this output, we need to write it to a log file. But how do we find out where we need to make changes? We recommend you think about this from the start, and ensure that all intentional output goes through a log function, or at least use an explicit ⎕← so that output can easily be identified in the source.

Unwanted output to the session

diff --git a/HTML/10-Make.html b/HTML/10-Make.html index 07b17fa..147d5b3 100644 --- a/HTML/10-Make.html +++ b/HTML/10-Make.html @@ -202,7 +202,7 @@

Make the application

More complex scenarios

In a more complex application than ours you might prefer a different approach. Using an INI file for this is not a bad idea: it gives you scope to define more than just the modules to be loaded, and some code to execute.

-

Also, if you have not one butseveral applications to support, it is useful to implement your own generalised user command like ]runmake.

+

Also, if you have not one but several applications to support, it is useful to implement your own generalised user command like ]runmake.

Execute, Tester and Tests have no place in the finished application, nor do we need the test helpers either.

@@ -411,7 +411,7 @@

Exporting

details,←⊂'ProductVersion'(2⊃##.MyApp.Version) details,←⊂'LegalCopyright' 'Dyalog Ltd 2018' details,←⊂'ProductName' 'MyApp' - details,←⊂'FileVersion' '1.2.3.4' + details,←⊂'FileVersion' (2⊃##.MyApp.Version) details←↑details success←try←0 fn←DESTINATION,'\',exeName ⍝ filename @@ -432,8 +432,16 @@

Exporting

Export automates what we’ve done so far by calling the Export command from the File menu. If the Bind method fails, it retries up to 50 times before giving up.

From experience we know that, with the OS, the machine, the network, the filesystem and who knows what else, the command can fail several times before finally succeeding.

+
+Information +
+

Why is there a “ProductVersion” and a “FileVersion”? No idea! On Stack Overflow this was discussed more than once, and it seems that there are very few cases were it might make sense to have them not in sync.

+

But “FileVersion” is the more important one: the Inno installer for example (see chapter 16 “Creating SetUp.exe”) compares the “FileVersion” of an already installed version with the possibly new version, and if they are not different then it won't overwrite the EXE - you don't want that!

+
+
+
-

The Bind method

+

The Bind method

Note that for the Bind method to work as discussed in this chapter you must use at least version 16.0.31811.0 of Dyalog. Before that Bind was not an official method and did not support the details.

diff --git a/HTML/11-Providing-help.html b/HTML/11-Providing-help.html index 5e97866..56a4377 100644 --- a/HTML/11-Providing-help.html +++ b/HTML/11-Providing-help.html @@ -99,7 +99,7 @@

11. Providing help

Users expect applications to provide help in one way or another. One option is to provide the help as a hypertext system. Under Windows, CHM files are the standard way to provide such help. There are powerful applications available that can assist you in providing help; HelpAndManual [1] is just an example.

-

However, we take a different approach here: rather than using any third-party software we use Markdown2Help from the APLTree library. That allows us to create a help system that:

+

However, we take a different approach here: rather than using any third-party software we use Markdown2Help from the APL_cation [2] project. That allows us to create a help system that:

+
  • Potential problems +
  • Conclusion @@ -466,6 +475,49 @@

    The section [Code]

    Inno comes with a built-in script language that allows you to do pretty much whatever you like. However, scripting is beyond the scope of this chapter.

    + +

    Potential problems

    +
    +
    +
    + +

    Updating an already installed version

    +
    +
    +

    There is no need to take action - Inno will handle this automatically for you. There is however one exception and one pitfall:

    +
    + +

    Files that are not needed any longer

    +
    +
    +

    Inno won't (can't) delete those automatically. This is the recommended way to delete files:

    +
    [InstallDelete]
    +Type: files; Name: {app}\foo.bar
    +Type: files; Name: {app}\baz\quux.txt
    +

    Although wildcards are supported they should never be used because you may well delete user files.

    +
    + +

    The EXE

    +
    +
    +

    When an EXE is part of the installation Inno compares the “FileVersion” of what's already installed with the one that is about to be installed. It they match Inno won't take any action. That means that if you forget to set the “FileVersion” (see chapter 10: “Make: Export”) when creating the stand-alone EXE then it will always be 0.0.0.0, so they won't ever differ, and the first installed EXE will never be replaced!

    +
    + +

    Analyzing problems

    +
    +
    +

    A problem like the aforementioned one won't cause an error message; you just don't get the new EXE installed. Assuming that you have been careful enough to realize that there is a problem, how to get to the bottom of it?

    +

    If the installer does not behave as expected add /LOG={filename} to it. Then Inno will report all actions and even conclusions to that file.

    +

    In the above scenario you would find something similiar to this in the log file:

    +
    2018-05-08 06:26:30.826   -- File entry --
    +2018-05-08 06:26:30.827   Dest filename: C:\Program Files (x86)\..\Foo.exe
    +2018-05-08 06:26:30.827   Time stamp of our file: 2018-05-07 13:07:26.000
    +2018-05-08 06:26:30.827   Dest file exists.
    +2018-05-08 06:26:30.827   Time stamp of existing file: 2018-05-07 12:51:24.000
    +2018-05-08 06:26:30.827   Version of our file: 0.0.0.0
    +2018-05-08 06:26:30.832   Version of existing file: 0.0.0.0
    +2018-05-08 06:26:30.832   Same version. Skipping.
    +

    Conclusion

    diff --git a/HTML/17-Regular-Expressions.html b/HTML/17-Regular-Expressions.html index d4aec15..fcfd64b 100644 --- a/HTML/17-Regular-Expressions.html +++ b/HTML/17-Regular-Expressions.html @@ -4,14 +4,68 @@ RegEx - - - + + + + + + -
    -

    In a runtime interpreter or an EXE, there is no APL session, and output to the session which would have been visible in a development system will simply disappear. If we want to see this output, we need to write it to a log file.

    -

    But how do we find out where we need to make changes? We recommend you think about this from the start, and ensure that all intentional output goes through a log function, or at least use an explicit ⎕← so that output can easily be identified in the source.

    +

    In a runtime interpreter or an EXE, there is no APL session, and output to the session which would have been visible in a development system will simply disappear.

    + +
    +Information +
    +

    Note that output assigned to or does not stop the runtime executable.

    +

    However, when the result of a function is neither consumed by another function nor assigned to a variable then you will see the message “This Dyalog APL runtime application has attempted to use the APL session and therefore be closed.”, and that will be the end of it.

    +
    +
    + +

    If we want to see this output, we need to write it to a log file. But how do we find out where we need to make changes? We recommend you think about this from the start, and ensure that all intentional output goes through a log function, or at least use an explicit ⎕← so that output can easily be identified in the source.

    Unwanted output to the session

    @@ -3545,7 +3554,7 @@

    3. Make the application

    More complex scenarios

    In a more complex application than ours you might prefer a different approach. Using an INI file for this is not a bad idea: it gives you scope to define more than just the modules to be loaded, and some code to execute.

    -

    Also, if you have not one butseveral applications to support, it is useful to implement your own generalised user command like ]runmake.

    +

    Also, if you have not one but several applications to support, it is useful to implement your own generalised user command like ]runmake.

    Execute, Tester and Tests have no place in the finished application, nor do we need the test helpers either.

    @@ -3754,7 +3763,7 @@

    3.6. Exporting

    details,←⊂'ProductVersion'(2⊃##.MyApp.Version) details,←⊂'LegalCopyright' 'Dyalog Ltd 2018' details,←⊂'ProductName' 'MyApp' - details,←⊂'FileVersion' '1.2.3.4' + details,←⊂'FileVersion' (2⊃##.MyApp.Version) details←↑details success←try←0 fn←DESTINATION,'\',exeName ⍝ filename @@ -3775,8 +3784,16 @@

    3.6. Exporting

    Export automates what we’ve done so far by calling the Export command from the File menu. If the Bind method fails, it retries up to 50 times before giving up.

    From experience we know that, with the OS, the machine, the network, the filesystem and who knows what else, the command can fail several times before finally succeeding.

    +
    +Information +
    +

    Why is there a “ProductVersion” and a “FileVersion”? No idea! On Stack Overflow this was discussed more than once, and it seems that there are very few cases were it might make sense to have them not in sync.

    +

    But “FileVersion” is the more important one: the Inno installer for example (see chapter 16 “Creating SetUp.exe”) compares the “FileVersion” of an already installed version with the possibly new version, and if they are not different then it won't overwrite the EXE - you don't want that!

    +
    +
    +
    -

    The Bind method

    +

    The Bind method

    Note that for the Bind method to work as discussed in this chapter you must use at least version 16.0.31811.0 of Dyalog. Before that Bind was not an official method and did not support the details.

    @@ -3854,7 +3871,7 @@

    Chapter 11:

    Providing h

    Users expect applications to provide help in one way or another. One option is to provide the help as a hypertext system. Under Windows, CHM files are the standard way to provide such help. There are powerful applications available that can assist you in providing help; HelpAndManual [1] is just an example.

    -

    However, we take a different approach here: rather than using any third-party software we use Markdown2Help from the APLTree library. That allows us to create a help system that:

    +

    However, we take a different approach here: rather than using any third-party software we use Markdown2Help from the APL_cation [2] project. That allows us to create a help system that:

    - -

    6. Attention: empty vectors

    +
    +

    6. Warnings

    +
    +
    +
    + +

    6.1. The . character

    +
    +
    +

    Be very careful whith the . in RegEx: because it matches every character except newline (and with ('DotAll' 1) even newline) it can produce unwanted results, in particular with ('Greedy' 1) but not restricted to that.

    +

    Because it's so powerful it allows you to be lazy: you write a RegEx and it matches everything that you want it to match, but it might always match everything, including stuff it shouldn't!

    +

    To illustrate the point let's assume that we want to match a date in a text vector in the international date format (yyyy-mm-dd). The naive approach with a dot works fine:

    +
          '\d\d\d\d.\d\d.\d\d'⎕S 0 ⊣'1988-02-03'
    +0
    +

    Not really:

    +
          '\d\d\d\d.\d\d.\d\d'⎕S 0 ⊣'1988/02/03'
    +0
    +

    While this might be acceptable because it seems to give the user the freedom to use a different separator the following example is certainly not acceptable:

    +
          '\d\d\d\d.\d\d.\d\d'⎕S 0 ⊣'1988020312'
    +0
    +

    Its's much better to specify what's excepted as separator explicitly:

    +
          '\d\d\d\d[-./ ]\d\d[-./ ]\d\d'⎕S 0⊣'1988/02/03'
    +0
    +

    Even this has it's problems:

    +
          '\d\d\d\d[-./ ]\d\d[-./ ]\d\d'⎕S 0⊣'1988 02/03'
    +0
    +      '\d\d\d\d[-./ ]\d\d[-./ ]\d\d'⎕S 0⊣'1988-99-99'
    +0
    +

    Whether that's acceptable or not depends on the application.

    +
    + +

    6.2. Assumptions

    +
    +
    +

    One of the greatest problems in programming is making assumptions and not document them. Or worse, not even being aware of your assumptions.

    +

    The above is an example. Imagine these two different scenarios:

    +
      +
    1. You want to extract everything from a log file that's a date. You know that every record, if it carries a date at all, will start with the date, and you can savely assume that the dates are correctly saved in international date format.
    2. +
    3. You allow the user to enter her date of birth in a dialog box.
    4. +
    +

    In the first case you can take a relaxed approach because you know all dates are valid and follow precise rules while in the second you have to be meticulous because otherwise you will accept and save rubbish sooner rather than later.

    +
    + +

    6.3. Empty vectors

    Given this variable:

    @@ -7272,7 +7386,7 @@

    6. Attention: empty vectors

    │ │ │ │A paragraph. │ │ │ │ │ └─┘ └──────────────────┘ └─┘ │ └∊─────────────────────────────┘ -

    This is so in version 16.0, but might change in a future version of Dyalog.

    +

    That's what happens in version 16.0. Be aware that this might change in a later version of Dyalog.

    7. Miscellaneous

    @@ -7283,25 +7397,35 @@

    7. Miscellaneous

    7.1. Tests

    -

    Complex regular expressions are hard to read and maintain. Document them intensively, with exhaustive test cases.

    +

    Complex regular expressions are hard to read and maintain. Document them intensively and cover them with exhaustive test cases.

    +

    At first this might seem overkill, but as usual tests will prove to be useful when you need to…

    +

    7.2. Performance

    Don't expect regular expressions to be faster than a tailored APL solution; expect them to be slightly slower.

    -

    However, many regular expressions, like finding a simple string in another simple string or uppercasing or lowercasing characters are converted by the interpreter into a native (faster) APL expression ( and ⌶ 819 respectively).

    +

    However, many regular expressions, like finding a simple string in another simple string or uppercasing or lowercasing characters are converted by the interpreter into a native (faster) APL expression ( and ⌶ 819 respectively) anyway.

    7.3. Helpful stuff

    +
    Online Tutotrial
    +

    A web site that explores Regular Expressions in detail:

    +

    https://www.regular-expressions.info/tutorial.html

    +

    From the author of RegExBuddy.

    RegexBuddy
    -
    Software that helps interpret or build regular expressions
    -
    http://www.regular-expressions.info/tutorial.html
    -

    A web site that explores the details. From the author of RegExBuddy.

    -

    The web site also comes with detailed book reviews: http://www.regular-expressions.info/hipowls.html

    +

    Software that helps interpret or build regular expressions:

    +

    https://www.regexbuddy.com/

    +
    Book reviews
    +

    The aforementioned website comes with detailed book reviews:

    +

    https://www.regular-expressions.info/hipowls.html

    @@ -8840,7 +8964,7 @@

    2. Define your function keys

    ⎕SHADOW⊃list←'LL' 'DB' 'DI' 'ER' 'LC' 'DC' 'UC' 'RD' 'RL' 'RC' 'Rl' 'Ll' 'CP' 'PT' 'BH' ⍎¨{⍵,'←⊂''',⍵,''''}¨list r⍪←'F01'('')('(Reserved for help)') - r⍪←'F02'(')WSID',ER)(')wsid') + r⍪←'F02'(')WSID',ER)(')wsid') r⍪←'F03'('')('Show next hit') ⍝ Reserved for NX r⍪←'F04'('⎕SE.Display ')('Call "Display"') r⍪←'F05'(LL,'→⎕LC+1 ⍝ ',ER)('→⎕LC+1') diff --git a/HTML/Images/Stand-alone-properties.png b/HTML/Images/Stand-alone-properties.png index e5b8dd3..348b0c8 100644 Binary files a/HTML/Images/Stand-alone-properties.png and b/HTML/Images/Stand-alone-properties.png differ diff --git a/HTML/Images/_ReadMe.txt b/HTML/Images/_ReadMe.txt new file mode 100644 index 0000000..00975eb --- /dev/null +++ b/HTML/Images/_ReadMe.txt @@ -0,0 +1 @@ +All images are resized by 80% \ No newline at end of file diff --git a/HTML/index.html b/HTML/index.html index 50fe09f..cb1fd5d 100644 --- a/HTML/index.html +++ b/HTML/index.html @@ -52,7 +52,7 @@

    Appendicies

  • Development environment
  • Special characters
  • -

    View as single HTML file

    +

    All chapters as one HTML file (for printing)

    \ No newline at end of file diff --git a/code/v10/Make.dyalog b/code/v10/Make.dyalog index 5cf34d0..cd6157b 100644 --- a/code/v10/Make.dyalog +++ b/code/v10/Make.dyalog @@ -39,7 +39,7 @@ details,←⊂'ProductVersion'(2⊃##.MyApp.Version) details,←⊂'LegalCopyright' 'Dyalog Ltd 2018' details,←⊂'ProductName' 'MyApp' - details,←⊂'FileVersion' '1.2.3.4' + details,←⊂'FileVersion' (2⊃##.MyApp.Version) details←↑details success←try←0 fn←DESTINATION,'\',exeName ⍝ filename diff --git a/code/v11/Make.dyalog b/code/v11/Make.dyalog index 059abd1..aeb30f9 100644 --- a/code/v11/Make.dyalog +++ b/code/v11/Make.dyalog @@ -45,7 +45,7 @@ details,←⊂'ProductVersion'(2⊃##.MyApp.Version) details,←⊂'LegalCopyright' 'Dyalog Ltd 2018' details,←⊂'ProductName' 'MyApp' - details,←⊂'FileVersion' '1.2.3.4' + details,←⊂'FileVersion' (2⊃##.MyApp.Version) details←↑details success←try←0 fn←DESTINATION,'\',exeName ⍝ filename diff --git a/code/v12/Make.dyalog b/code/v12/Make.dyalog index de62114..9dbd68f 100644 --- a/code/v12/Make.dyalog +++ b/code/v12/Make.dyalog @@ -45,7 +45,7 @@ details,←⊂'ProductVersion'(2⊃##.MyApp.Version) details,←⊂'LegalCopyright' 'Dyalog Ltd 2018' details,←⊂'ProductName' 'MyApp' - details,←⊂'FileVersion' '1.2.3.4' + details,←⊂'FileVersion' (2⊃##.MyApp.Version) details←↑details success←try←0 fn←DESTINATION,'\',exeName ⍝ filename diff --git a/code/v13/Make.dyalog b/code/v13/Make.dyalog index 7bb69cd..d3bfcc0 100644 --- a/code/v13/Make.dyalog +++ b/code/v13/Make.dyalog @@ -45,7 +45,7 @@ details,←⊂'ProductVersion'(2⊃##.MyApp.Version) details,←⊂'LegalCopyright' 'Dyalog Ltd 2018' details,←⊂'ProductName' 'MyApp' - details,←⊂'FileVersion' '1.2.3.4' + details,←⊂'FileVersion' (2⊃##.MyApp.Version) details←↑details success←try←0 fn←DESTINATION,'\',exeName ⍝ filename diff --git a/code/v14/Make.dyalog b/code/v14/Make.dyalog index 059abd1..aeb30f9 100644 --- a/code/v14/Make.dyalog +++ b/code/v14/Make.dyalog @@ -45,7 +45,7 @@ details,←⊂'ProductVersion'(2⊃##.MyApp.Version) details,←⊂'LegalCopyright' 'Dyalog Ltd 2018' details,←⊂'ProductName' 'MyApp' - details,←⊂'FileVersion' '1.2.3.4' + details,←⊂'FileVersion' (2⊃##.MyApp.Version) details←↑details success←try←0 fn←DESTINATION,'\',exeName ⍝ filename diff --git a/manuscript/10-Make.md b/manuscript/10-Make.md index fced784..f74d933 100644 --- a/manuscript/10-Make.md +++ b/manuscript/10-Make.md @@ -121,7 +121,7 @@ A> # More complex scenarios A> A> In a more complex application than ours you might prefer a different approach. Using an INI file for this is not a bad idea: it gives you scope to define more than just the modules to be loaded, and some code to execute. A> -A> Also, if you have not one butseveral applications to support, it is useful to implement your own generalised user command like `]runmake`. +A> Also, if you have not one but several applications to support, it is useful to implement your own generalised user command like `]runmake`. `Execute`, `Tester` and `Tests` have no place in the finished application, nor do we need the test helpers either. @@ -381,7 +381,7 @@ leanpub-end-insert details,←⊂'ProductVersion'(2⊃##.MyApp.Version) details,←⊂'LegalCopyright' 'Dyalog Ltd 2018' details,←⊂'ProductName' 'MyApp' - details,←⊂'FileVersion' '1.2.3.4' + details,←⊂'FileVersion' (2⊃##.MyApp.Version) details←↑details success←try←0 fn←DESTINATION,'\',exeName ⍝ filename @@ -405,7 +405,11 @@ leanpub-end-insert From experience we know that, with the OS, the machine, the network, the filesystem and who knows what else, the command can fail several times before finally succeeding. -A> # The _Bind_ method +I> Why is there a "ProductVersion" and a "FileVersion"? No idea! On Stack Overflow this was discussed more than once, and it seems that there are very few cases were it might make sense to have them **not** in sync. +I> +I> But "FileVersion" is the more important one: the Inno installer for example (see [chapter 16 "Creating SetUp.exe"](./16-Creating-SetUp.exe.html)) compares the "FileVersion" of an already installed version with the possibly new version, and if they are not different then it won't overwrite the EXE - you don't want that! + +A> # The `Bind` method A> A> Note that for the `Bind` method to work as discussed in this chapter you must use at least version 16.0.31811.0 of Dyalog. Before that `Bind` was not an official method and did not support the `details`. diff --git a/manuscript/12-Scheduled-Tasks.md b/manuscript/12-Scheduled-Tasks.md index ce81404..3042324 100644 --- a/manuscript/12-Scheduled-Tasks.md +++ b/manuscript/12-Scheduled-Tasks.md @@ -352,7 +352,7 @@ A> Sadly, the error messages are not always that helpful. The above message appe If for some reason you’ve created `MyApp.exe` by binding the application to the development version of Dyalog rather than the runtime (you can do this by providing a 0 as left argument to the `MakeExport` function) then you might run into a problem. Our code notices whether it is running under a development EXE or a runtime EXE. Error trapping will be inactive (unless it is enforced via the INI) and `⎕OFF` won’t be executed; instead it would execute `→` and hang around but without you being able to see the session. -So don’t do this. Because you have Ride, the development version has no advantages over the runtime EXE anyway. +So don’t do this. Because you have Ride at your disposal the development version has no advantages over the runtime EXE anyway. ### Your application doesn’t do what it’s supposed to do diff --git a/manuscript/16-Creating-SetUp.exe.md b/manuscript/16-Creating-SetUp.exe.md index b652a50..b5c5869 100644 --- a/manuscript/16-Creating-SetUp.exe.md +++ b/manuscript/16-Creating-SetUp.exe.md @@ -426,6 +426,53 @@ That would overwrite the internal message. Inno comes with a built-in script language that allows you to do pretty much whatever you like. However, scripting is beyond the scope of this chapter. + +Potential problems +------------------ + +### Updating an already installed version + +There is no need to take action - Inno will handle this automatically for you. There is however one exception and one pitfall: + + +#### Files that are not needed any longer + +Inno won't (can't) delete those automatically. This is the recommended way to delete files: + +~~~ +[InstallDelete] +Type: files; Name: {app}\foo.bar +Type: files; Name: {app}\baz\quux.txt +~~~ + +Although wildcards are supported they should never be used because you may well delete user files. + + +#### The EXE + +When an EXE is part of the installation Inno compares the "FileVersion" of what's already installed with the one that is about to be installed. It they match Inno won't take any action. That means that if you forget to set the "FileVersion" (see [chapter 10: "Make: Export"](./10-Make.html#Exporting)) when creating the stand-alone EXE then it will always be 0.0.0.0, so they won't ever differ, and the first installed EXE will never be replaced! + + +### Analyzing problems + +A problem like the aforementioned one won't cause an error message; you just don't get the new EXE installed. Assuming that you have been careful enough to realize that there is a problem, how to get to the bottom of it? + +If the installer does not behave as expected add `/LOG={filename}` to it. Then Inno will report all actions and even conclusions to that file. + +In the above scenario you would find something similiar to this in the log file: + +~~~ +2018-05-08 06:26:30.826 -- File entry -- +2018-05-08 06:26:30.827 Dest filename: C:\Program Files (x86)\..\Foo.exe +2018-05-08 06:26:30.827 Time stamp of our file: 2018-05-07 13:07:26.000 +2018-05-08 06:26:30.827 Dest file exists. +2018-05-08 06:26:30.827 Time stamp of existing file: 2018-05-07 12:51:24.000 +2018-05-08 06:26:30.827 Version of our file: 0.0.0.0 +2018-05-08 06:26:30.832 Version of existing file: 0.0.0.0 +2018-05-08 06:26:30.832 Same version. Skipping. +~~~ + + Conclusion ---------- diff --git a/manuscript/images/Stand-alone-properties.png b/manuscript/images/Stand-alone-properties.png index e5b8dd3..348b0c8 100644 Binary files a/manuscript/images/Stand-alone-properties.png and b/manuscript/images/Stand-alone-properties.png differ diff --git a/manuscript/images/_ReadMe.txt b/manuscript/images/_ReadMe.txt new file mode 100644 index 0000000..00975eb --- /dev/null +++ b/manuscript/images/_ReadMe.txt @@ -0,0 +1 @@ +All images are resized by 80% \ No newline at end of file