Skip to content

Commit

Permalink
Creating new release and uploading script to create installer
Browse files Browse the repository at this point in the history
  • Loading branch information
fhalamos committed Nov 2, 2020
1 parent ef13cc9 commit 4c5e346
Show file tree
Hide file tree
Showing 7 changed files with 155 additions and 18 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# PII Application

### About
This application identifies likely PII (personally identifiable information) in a dataset. To use, download the .exe from the latest release and follow the in-app directions.
This application identifies likely PII (personally identifiable information) in a dataset. To use, download the .exe installer from the [latest release](https://github.com/PovertyAction/PII_detection/releases/latest) and follow the in-app directions.

This tool is current listed as an alpha release because it is still being tested on IPA PII-containing field datasets.

Expand Down Expand Up @@ -49,5 +49,11 @@ J-PAL: PII-Scan. 2017. https://github.com/J-PAL/PII-Scan

The PII script is [MIT Licensed](https://github.com/PovertyAction/PII_detection/blob/master/LICENSE).

### To create .exe from source file
`pyinstaller --onefile --windowed --icon=app.ico --add-data="app.ico;." --add-data="ipa_logo.jpg;." --additional-hooks-dir=. --hiddenimport srsly.msgpack.util app_frontend.py`
### Distribution

#### To create executable app
`pyinstaller --windowed --icon=app_icon.ico --add-data="app_icon.ico;." --add-data="ipa_logo.jpg;." --additional-hooks-dir=. --hiddenimport srsly.msgpack.util app_frontend.py`

#### To create windows application installer
Compile `create_installer.iss` using Inno Setup Compiler
<!-- Reference: https://www.youtube.com/watch?v=RrpvNvklmFA -->
25 changes: 22 additions & 3 deletions app_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
from PIL import ImageTk, Image
import webbrowser
import os
import requests

import PII_data_processor

from constant_strings import *

intro_text = "This script is meant to assist in the detection of PII (personally identifiable information) and subsequent removal from a dataset. This is an alpha program, not fully tested yet."
intro_text_p2 = "You will first load a dataset that might contain PII variables. The system will try to identify the PII candidates. Please indicate if you would like to Drop, Encode or Keep them to then generate a new de-identified dataset."#, built without access to datasets containing PII on which to test or train it. Please help improve the program by filling out the survey on your experience using it (Help -> Provide Feedback)."
app_title = "IPA's PII Detector - v0.2.17"
version_number = "0.2.18"
app_title = "IPA's PII Detector - v"+version_number

#Maps pii to action to do with them
pii_candidates_to_dropdown_element = {}
Expand Down Expand Up @@ -333,9 +335,9 @@ def window_setup(master):

#Add window icon
if hasattr(sys, "_MEIPASS"):
icon_location = os.path.join(sys._MEIPASS, 'app.ico')
icon_location = os.path.join(sys._MEIPASS, 'app_icon.ico')
else:
icon_location = 'app.ico'
icon_location = 'app_icon.ico'
master.iconbitmap(icon_location)

#Set window position and max size
Expand Down Expand Up @@ -616,6 +618,20 @@ def import_file():

return first_view_frame

def check_for_updates():
if internet_connection:
#Get version of latest release
response = requests.get("https://api.github.com/repos/PovertyAction/PII_detection/releases/latest")
latest_version = response.json()["tag_name"]

#Case it has a v before version number, remove it
latest_version = latest_version.replace("v","")

#Check if this version_number is different to latest
if version_number != latest_version:

messagebox.showinfo("Message", "Version "+latest_version+ " is available. You can uninstall this version from Control Panel and download latest from https://github.com/PovertyAction/PII_detection/releases/latest")

if __name__ == '__main__':

#Check internet connection
Expand Down Expand Up @@ -657,5 +673,8 @@ def import_file():
#Create first view page
first_view_frame = create_first_view_page(internet_connection)

#Check for updates of this program
check_for_updates()

# Constantly looping event listener
root.mainloop()
File renamed without changes.
4 changes: 2 additions & 2 deletions constant_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
UGANDA = 'Uganda'
ZAMBIA = 'Zambia'

ALL_COUNTRIES = [PHILIPPINES,BOLIVIA,COLOMBIA,DOMINICAN_REPUBLIC,MEXICO,PARAGUAY,PERU,BURKINA_FASO,COTE_DIVOIRE,GHANA,LIBERIA,MALI,SIERRA_LEONE,KENYA,MALAWI,RWANDA,TANZANIA,UGANDA,ZAMBIA]
ALL_COUNTRIES = [PHILIPPINES,BOLIVIA,COLOMBIA,DOMINICAN_REPUBLIC,MEXICO,PARAGUAY,PERU,BURKINA_FASO,COTE_DIVOIRE,GHANA,LIBERIA,MALI,SIERRA_LEONE,KENYA,MALAWI,RWANDA,TANZANIA,UGANDA,ZAMBIA, MYANMAR, BANGLADESH]

COUNTRY_NAME_TO_ISO_CODE = {
MEXICO:'mx',
Expand All @@ -73,4 +73,4 @@
TANZANIA : 'tz',
UGANDA : 'ug',
ZAMBIA : 'zm'
}
}
122 changes: 122 additions & 0 deletions create_installer.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{94D8F08C-01F1-46FF-89DF-EB240476F308}
AppName=PII Detector
AppVersion=0.2.18
;AppVerName=PII Detector 0.2.18
AppPublisher=IPA
AppPublisherURL=https://www.poverty-action.org/
AppSupportURL=https://www.poverty-action.org/
AppUpdatesURL=https://www.poverty-action.org/
DefaultDirName={autopf}\PII Detector
DisableProgramGroupPage=yes
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
OutputDir=C:\Users\felip\PII_detection\dist
OutputBaseFilename=installer
SetupIconFile=C:\Users\felip\PII_detection\dist\app_frontend\app_icon.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern
UninstallDisplayIcon=C:\Users\felip\PII_detection\dist\app_frontend\app_icon.ico

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "C:\Users\felip\PII_detection\dist\app_frontend\app_frontend.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\_asyncio.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\_bz2.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\_cffi_backend.cp38-win_amd64.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\_ctypes.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\_decimal.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\_elementtree.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\_hashlib.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\_lzma.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\_multiprocessing.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\_overlapped.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\_queue.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\_socket.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\_sqlite3.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\_ssl.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\_testcapi.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\_tkinter.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\_win32sysloader.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\app_frontend.exe.manifest"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\app_icon.ico"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\base_library.zip"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\ipa_logo.jpg"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\kiwisolver.cp38-win_amd64.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\lib_arpack-.2SFL42HHZ4PZ2ZKTBHULWLJDO6SPOBMX.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\lib_blas_su.SXX6OHFC3HLK4TC7SFHY7EWYWTE5NEP4.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\lib_dop-f2p.MT27WXU45SIAX6ASQY7CWYIOK7BE6F7J.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\lib_test_fo.JF5HTWMUPBXWGAYEBVEJU3OZAHTSVKCT.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libansari.R6EA3HQP5KZ6TAXU4Y4ZVTRPT7UVA53Z.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libbanded5x.UEB2FLNQUK6ENP6F3JWHGFRKAZK4HKSY.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libbispeu.7AH3PCQ2E2NGLC3AQD7FFAH73KGJTZCJ.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libblkdta00.37OSC2UPECTMIA7QHKFZHTBBNLYMZSNK.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libchkder.G7WSOGIYYQO3UWFVEZ3PPXCXR53ADVPA.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libcobyla2.25EVUSEBAW7VKISARB7LO3UGZPN2HXE3.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libcrypto-1_1.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libd_odr.7J2262VJOKVQJ7Z3VSIPRAHJ2HVZT6XS.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libdcsrch.I2AOPDCXAPDRFNPWY55H5UE7XZSU5CVN.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libdet.UUOGCNYYSRH3SKVQWBDSEP6DWIQWRKZZ.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libdfft.77WLEPRRLEPFIH4KZHFRYQ2UQCA5NONS.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libdfitpack.LMAPXDO5462XTHNWXJBZFJU252ZVABKI.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libdgamln.733CLDMODMP7N4V4VYG5MATCENMLG4I7.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libdqag.PQITPNDDR3HSJ44XDB4N3Z7BDX2UD3YH.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libffi-7.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libgetbreak.SA5VDN7OR4E3PWZFT4TPMX4W2XB5FYNN.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\liblbfgsb.NEXG7QLBFLBCFD42PO5V4IWCPCUGPOCB.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\liblsoda-f2.5XWPH7KY2GYX4D6G5T6U6R45H4XHBJNK.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libmvndst.IUWFZM2WSUQ3UTGQHFQ26ATH2A2TIUVI.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libnnls.4HUTGAJQTI623WTX372VAIIWXRLC62YU.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libopenblas.3HBPCJB5BPQGKWVZAVEBXNNJ2Q2G3TUP.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libopenblas.PYQHXLVVQ7VESDPUVUADXEVJOBGHJPAY.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libslsqp_op.RGGN6ZOFD2K47X7YRNDYCM7JFP4AGLER.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libspecfun.LQCTHMCYNULEOOGKIO6AGREE6D6V37RU.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libssl-1_1.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libvode-f2p.RRWIMSVJVJPENFKJSLUK5L6Z2HONNEBQ.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libwrap_dum.FFMEUDAAWA4OWVO76EOZPAZXI2N7FSIX.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\libwrap_dum.TETSETQV7VQPKMY44CVVUBZUQEOXJF73.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\mfc140u.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\msvcp140.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\pvectorc.cp38-win_amd64.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\pyexpat.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\python38.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\pythoncom38.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\pywintypes38.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\select.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\sqlite3.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\tcl86t.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\tk86t.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\unicodedata.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\VCRUNTIME140.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\win32api.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\win32clipboard.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\win32evtlog.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\win32pdh.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\win32security.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\win32trace.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\win32ui.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\win32wnet.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\winpty.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\felip\PII_detection\dist\app_frontend\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Permissions: users-modify
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{autoprograms}\PII Detector"; Filename: "{app}\app_frontend.exe"
Name: "{autodesktop}\PII Detector"; Filename: "{app}\app_frontend.exe"; Tasks: desktopicon
Name: "{autoprograms}\PII Detector"; Filename: "{app}\app_frontend.exe"; IconFilename: "{app}\app_icon.ico"
Name: "{autodesktop}\PII Detector"; Filename: "{app}\app_frontend.exe"; IconFilename: "{app}\app_icon.ico"

[Run]
Filename: "{app}\app_frontend.exe"; Description: "{cm:LaunchProgram,PII Detector}"; Flags: nowait postinstall skipifsilent

7 changes: 0 additions & 7 deletions dist/README.md

This file was deleted.

3 changes: 0 additions & 3 deletions dist/pii_detector_v0.2.17.zip

This file was deleted.

0 comments on commit 4c5e346

Please sign in to comment.