This is our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

I created one plugin in lua. now i am making installer for that using NSIS At the time of uninstallation of my plugin i want to check if wireshark is running than donot uninstall it. I got logic todo that from wireshark.nsi(logic is defined in common.nsh) file.But in that logic there is mentioned one GUID Number {9CA78EEA-EA4D-4490-9240-FC01FCEF464B}. The logic of that file is mentioned below

${Do}

System::Call 'kernel32::OpenMutex(i 0x100000, b 0, t "Global\${PROGRAM_NAME}-is-running-{9CA78EEA-EA4D-4490-9240-FC01FCEF464B}") i .R0'
    IntCmp $R0 0 checkRunningSession
    System::Call 'kernel32::CloseHandle(i $R0)'
    Goto isRunning

checkRunningSession:
System::Call 'kernel32::OpenMutex(i 0x100000, b 0, t "${PROGRAM_NAME}-is-running-{9CA78EEA-EA4D-4490-9240-FC01FCEF464B}") i .R0'
    IntCmp $R0 0 notRunning
    System::Call 'kernel32::CloseHandle(i $R0)'

isRunning:
; You'd better go catch it.
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "${PROGRAM_NAME} or one of its associated programs is running.$\r$\nPlease close it first." /SD IDCANCEL IDRETRY continueChecking
Quit

notRunning:
${ExitDo}

I want to this GUID no is constant for wireshark?I mean is it same for platforms? If it so how it is integrated with Wireshark? Is it mentioned in wireshark source code?

asked 15 Jul '15, 02:42

ankit's gravatar image

ankit
65232328
accept rate: 25%


Yes it's a constant for all versions of Wireshark running on Windows and is defined in wsutil\file_util.c:

#define WIRESHARK_IS_RUNNING_UUID "9CA78EEA-EA4D-4490-9240-FC01FCEF464B"

arguably it should be in a header so it can be picked up by wireshark.nsi instead of being hard-coded, but it's unlikely to ever change.

permanent link

answered 15 Jul '15, 03:42

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

Thanks @grahamb for quick reply.May be my next question to you is not specific to wireshark. but i am just curious to know that how you guys generated this ID and integrated with wireshark? because as far as i know about GUID. it is generated by system itself randomly or by GUIDgen tool

(15 Jul '15, 04:00) ankit

Probably via a tool. The commit message is here.

Generating and using a GUID in this manner is perfectly safe, what's your concern?

(15 Jul '15, 05:39) grahamb ♦

Actually we have our own tool which is developed in Qt same as wireshark and it has problem like when the tool is open user can uninstall that but ideally it should not happen. then i have referred wireshark code to implement same logic to generate GUID. that's why i was asking. But now i get idea how to do that from your previous answer. Thanks again @grahamb

(16 Jul '15, 20:29) ankit
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×1,620
×25
×11
×2

question asked: 15 Jul '15, 02:42

question was seen: 1,399 times

last updated: 16 Jul '15, 20:29

p​o​w​e​r​e​d by O​S​Q​A