InnoSetup: Checking whether Microsoft Word is running

I am working on an update to the Word uTIlities. As part of the process, I wanted to update the installer to check for whether Word itself is running, as that causes an error in the installation when updating the Word uTIlities (as opposed to a new installation).

I have used Inno Setup right from the start, and have been very happy with its functioning and flexibility. So how to get it to check for Word?

The first tack I chose was based on this Stack Overflow thread—trying to get AppMutex to work. That, however, failed, because even though I tried loading my modification to the recommended code into the Word uTIlities template file’s ThisDocument object, the installer was not detecting it:

Option Explicit
'This is from the InnoSetup Help files:
'[Setup]: AppMutex

'Place in Declarations section:
Private Declare Function CreateMutex Lib "kernel32" _
        Alias "CreateMutexA" _
       (ByVal lpMutexAttributes As Long, _
        ByVal bInitialOwner As Long, _
        ByVal lpName As String) As Long

Private Sub Document_Open()
    'Place in startup code (Form_Load or Sub Main):
    CreateMutex 0&, 0&, "Word_uTIlities"

End Sub

Next I found this page, but when the link to the PSVince DLL failed, I stopped right there. It would still be nice to get the installer to offer to close down Word on my behalf, but my experience with other installers not always doing this in the way I would have liked convinced me that asking users to do it manually was not all bad.

So then, after a little more digging, I came across an example in the sample code file that actually does test for the presence of Microsoft Word. Starting with that, it was not a lot of work to modify it to get the Inno Setup script code below, which works quite well, I think. Take note, though, of this when testing while compiling your installer from the Inno Setup IDE—essentially, you have to test it by running the *.exe file.

[Code]
function InitializeSetup(): Boolean;
var
  Word: Variant;
begin
  try
    Word := GetActiveOleObject('Word.Application');
  except
  end;
  
  if VarIsEmpty(Word) then
    Result := True
     //Do nothing, Word is not found
  else begin
    MsgBox('Microsoft Word is running. Please close it before resuming the installer.', mbInformation, mb_Ok);
    Result := False;
  end;
end;

And that’s it! Again, Inno Setup proved itself up to the task, and I am satisfied with the end result.

Share

International Keyboard Shortcut Day 2019: Social media keyboard shortcuts

Yep. It’s that time of the year again.

I am not going to make this a long post, but I have to do something for IKSD 2019. I can’t let the momentum flag….

Let’s face it, social media is probably more effort than it’s worth. I could curse the people who came up with the idea, and yet, it was probably inevitable that something along these lines would be what the internet has developed into. The specifics, though, might have looked different if more thoughtful, more benevolent people had developed the concept. Dream on!

I have the distinct feeling that the idea behind the Matrix—of humans plugged into a machine which harvests their very life force while feeding them a dream-world-existence to keep them going, has found its very cruel reality in social media.

So while I find myself in the niggly situation of having to use social media for various things (club and school notices are posted on Facebook, group pages are used for functional activity, etc.), I do try to limit the amount of time I spend on social media (which is a constant battle, since the very premise of almost all social media sites is to set up their algorithms to maximise the time we spend on social media, so that they can harvest the maximum amount of data from us, expose us to the maximum amount of revenue-generating advertising, and turn the maximum profit on us. Yes, look yourself in the mirror each morning, and say to yourself “I am a social media profit centre.” And then look back down at your phone and give them your time like a good little slave.

So some things I do to minimise my time on social media are:

  • Minimise the services I use (Instagram? No. Snapchat? No? etc.). If there is no compelling reason other than gawking at other people, then I try to avoid it.
  • Use time tracking tools like RescueTime or ManicTime (I actually use both) and even the tracking tools on my phone, to constantly monitor the time I spend on social media, so that I can see when I am losing my foothold and getting sucked in. And no, I am not getting a kickback for recommending RescueTime or ManicTime (which is why I can post the links twice without creating suspicion).
  • Avoid using the phone apps provided by social media companies. I lasted one day, I seem to recall, on the Facebook Android app. It just has too much control, and really allows them to create a gravitational force that I was not able to stand up to (yes, know your weaknesses). So I deleted the app, and only access Facebook via the website from my phone. Which leads me to…
  • Spend as little time on these services from your phone as possible, and rather access them from your desktop or laptop. There are several advantages to this strategy.
    • The inconvenience factor (it’s just much easier to browse social media from the phone, so it’s easier to get sucked in).
    • The access via the website, not the app, mentioned above (yes, I know Facebook has a desktop app too—I don’t use it for a reason).
    • The ability to use browser apps like SocialFixer, which I highly recommend (and which I recommend you support—no kickbacks for me, again). These tools really help cut the crap, and help limit the time you spend on social media (e.g., SocialFixer limits the Facebook posts shown at one time, and it has the ability to mark all the posts on your page as being read, so they don’t appear again—a major way the social media companies get us to stay on their sites, because we want to scroll past the stuff we have seen, to get to the stuff we haven’t seen).
    • And then also the ability to use keyboard shortcuts to speed up the process, which brings me to this post.

However, since the lists of keyboard shortcuts have been adequately enumerated elsewhere, I am not going to replicate them all here. Just provide you with some links to good lists, and recommend that you cultivate the discipline of using these, again with the aim of cutting down your time on social media. Set yourself a target, try to keep to it, and use the time you gain for some productive work, or rather put down the phone, turn off the computer, and use the extra time doing something you like with someone you love. That will have a far greater positive impact on your life than any amount of social media browsing you could ever cram in.

So, without further ado, go and work through some of these pages, and learn and use these shortcuts:

https://www.wix.com/blog/2013/09/keyboard-shortcuts-facebook-twitter/

https://buffer.com/library/social-media-keyboard-shortcuts

https://blog.statusbrew.com/social-media-keyboard-shortcuts/

https://www.reddit.com/r/coolguides/comments/8062st/social_media_keyboard_shortcuts/

https://www.facebook.com/help/156151771119453

https://help.twitter.com/en/using-twitter/how-to-tweet

Share

Why I would not do my thesis with Word 2013 (and why I might)

I have been working with Word 2013 since the public beta was made available in October 2012—more than two years now.

While I have always had my pet peeves about the Office products, I have, in many ways, also been a bit of a fan boy for products like Word and Excel. Even with Word 2007, which many people deplored, and about which I had my own complaints, I was still quite able to see improvements which made the upgrade worthwhile. However, even after two years of use, I find myself particularly unimpressed with Word 2013. In fact, most of Office 2013 has left me rather unimpressed, if not downright disappointed. A prime example is the dumbed-down Presenter view in PowerPoint 2013—which Microsoft touted as a big improvement, but which is, in comparison to what PowerPoint 2010 offers, so pathetic that I refuse to do live presentation with PowerPoint 2013 if I can help it. Excel 2013 is the only program where, along with the regressions (like the dumbed-down sheet tab controls that I detest, and the dumbed-down charting tools that I find actually hinder the quick creation of charts), there are also noticeable improvements that matter to me. I suppose that’s an important point to make, because, of course, Microsoft has made many “improvements” to all their products in the 2013 iteration, it’s just that most of them are the kind that I could happily live without, and the things that are important to me, I find frustration.

In fact, if I stop to think about what it is I find so distasteful about Office 2013, it is that I feel it is a definite dumbing-down of the product. Some things are superficial and cosmetic (even after two years, I prefer the Office 2010 ribbon—which is, itself, a toned-down version of the too-loud Office 2007 ribbon—to the bland, dead Office 2013 ribbon). Or the new UI messages which are just too informal, even for me (actually, it’s not the informal that bothers me, but that fact that they have, at the same time, become uninformative). Other things are more serious, like the removal of tools that I actually use (see autocorrect below).

Positives

But before I make this one long gripefest, let me highlight some of the positives in Word 2013. You can see this article to see what’s new in Word 2013, most of my comments here relate to the new features.

Microsoft has made some significant changes to reviewing. While you will see below that some of them are negative, one positive is that reviewers can now comment on each other’s comments. The process is quite smooth, and, if a student and multiple promoters are all into electronic reviewing, a real time saver. Promoters can see what other promoters have said, and can weigh in themselves. Of course, we will all debate like adults, won’t we! J

Word 2013 now also offers the option to embed videos into a Word document. While PowerPoint has been able to do that for a very long time, it has always seemed a bit pointless in Word, but that has changed with the rise of eBooks and the rising popularity of multimedia content in eBooks. So while you still can’t print out a video on paper, put it into an eBook, and it could work. So there, Word is keeping with the times, and this an important addition.

Furthermore, Word 2013 now also has the image guides which were added in PowerPoint 2010, but not the rest of the 2010 Office suite. This also makes working with images much easier, and is a welcome addition, although it should have been available in Word 2010 already—I sometimes get the impression that the Office team doesn’t get time to complete all the planned work before the scheduled release date, and so we have one feature being progressively made available throughout the suite across several releases.

The integration of OneDrive giving you cloud storage of your documents is also a boon, but I must add that one does need to use the cloud “carefully.” If your account gets hacked, and your files get deleted, and those are the only copies around, you might be in for some trouble.

The layout of the Office 2013 applications are supposedly to also make them easier to use on small devices like tablets, but I find that a bit of a non-argument, as I really can’t see why I would want to do my thesis on a small device like that in the first place. Maybe for some extra work at the airport or on the road, yes, but for the data-to-day work needed to complete something big like that? No way!

Negatives

The Resume reading feature is a waste, since Shift+F5 has worked in every version of Word except Word 2007, and in any case the little message often disappears before you can click on it—what good is it then?

While I like the ability to comment on comments, the change to “simple “reviewing is a downright pain. Again, Microsoft dumbs things down, which may make them more unobtrusive, but also make them less efficient.

Microsoft removed AutoCorrect. I’m not alone in missing it. They say people never used it, which just means that they never survey people like me, who do use it. Fortunately, Greg Maxey shows how to fix this.

Microsoft also made important changes to the way their citation tools work which render even advice Microsoft posted about how to customise the tools invalid. I discuss some of these changes here. What really irks me is that they did not announce these changes in any way that I could find—they just made them. That is not the way to win or keep the confidence of your users.

Did I mention how much I detest the flat, uninspiring interface of Office 2013?

One of the things I really hate is the vanishing scroll bars. Type in Word, and the scroll bars disappear. Move the mouse and they momentarily reappear. I suspect this also has to do with getting Word ready for smaller screens, but for goodness sake, I have a big screen, and I am proficient enough to type for an extended period of time without have to resort to the mouse. I have grown accustomed to glancing at the scroll bar, as it provides important visual feedback as to where I am in a document (I read a lot of other people’s documents, so I need this information very frequently), and I still get irritated when I look in its direction to get that information, and it’s not there!

I have also found Word 2013 to be significantly slower than Word 2010. This is in all areas, from running macros (I have documented tests for running the same macro in both versions, showing Word 2013 to be up to 40% slower), to loading documents, saving documents, and even just the time it takes to open. I have Word 2010 and 2013 installed on my current system, so it has nothing to do with the system. The degraded performance is noticeable.

With Office 2013, Microsoft have gone all out for online help. That already irritates me, because getting online help is necessarily slower than getting installed help. When you click on Help in Office 2013, you don’t get a help browser that open—no, you get your web browser opening to go to Microsoft’s site. That takes a few seconds at best, and each time a web page loads, more time is lost. Thankfully, you can still set the Application help to Offline help, but the help from the VB Editor goes straight to the browser. And that’s the help I use the most. But it’s not just that that frustrates me. Microsoft has changed the very nature of their help content. The impression that I get is that, I would assume to save costs, they seem to have fired all their help-writing staff, and now all you get in your web browser is a search of various Microsoft sites and the rest of the Internet on your help topic. If I had wanted to go to a search engine to see what the rest of the world has to say on a topic, I would have done that. When I click on help, I expect to find the documentation provided by the people who made the program on how their program works. It seems harder to get that now than ever before.

One last thing (I think). I simply deplore the new dumbed-down spell checking pane which has replaced the old spelling and grammar dialog. Not only is it not now possible to ignore grammar rules, you can now also not edit the misspelled item in the dialog (e.g., if none of the suggested items matches what you actually intended to type–yes, I do type that badly!), but have to jump to the text to change it, and then resume spell checking. These are small changes, but I find that spelling & grammar checking now take much longer than they used to (i.e., a decrease in productivity). Oh, and to make matters worse, despite the buttons in the pane being marked with accelerators, they do not respond to the keyboard, so you have to manage the process with the mouse now, which is even slower! And it’s not just in the pane that the dumbed-down spell checking annoys me. I have already mentioned the missing auto-correct, but the long history of red, and green underlining for spelling and grammar errors, respectively, with blue added for contextual errors since Word 2007, has been changed. Now, in Word 2013, we have red for spelling errors, and blue for grammar and contextual errors. I realise that the choice of red, blue, and green may have been unfortunate for those who are colour blind, but why not include options in the interface to change those colours? Now, however, Word 2013 is giving me less information than Word 2007 and Word 2010 in terms of inline spell checking. And I find that annoying.

Summary

In short, if you asked me for advice, then unless you were a hardcore going-paperless-all-the-way student (who has promoters who can actually play along) or a cutting-edge creative arts student, where your thesis will incorporate video, I would tell you to stick with Word 2010 for your thesis.

I am still rooting for Microsoft, and I am hoping that Office 2016 will be to Office 2013 what Office 2010 was to Office 2007—the way it was meant to be.

Share