Skip to content

Commit 7c332be

Browse files
authored
New sign procedure (#39)
1 parent 0c8f0ee commit 7c332be

File tree

2 files changed

+41
-17
lines changed

2 files changed

+41
-17
lines changed

.github/workflows/ci_cd.yml

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -108,20 +108,6 @@ jobs:
108108
$ErrorActionPreference = "Stop"
109109
makensis setup.nsi
110110
111-
- name: Sign application
112-
shell: pwsh
113-
run: |
114-
$env:Path = "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\;" + $env:Path
115-
$filename = get-ChildItem dist -recurse | where {$_.name -like "*Setup*"}
116-
# Proceed to sign app
117-
signtool sign /f src\ansys\tools\installer\assets\python-installer.pfx `
118-
/fd SHA256 `
119-
/tr http://timestamp.digicert.com `
120-
/td SHA256 `
121-
/p '${{ secrets.PYTHON_INSTALLER_CERT_PWD }}' `
122-
/d Ansys-Python-Manager `
123-
$filename
124-
125111
- name: List output
126112
run: ls -R dist
127113

@@ -130,10 +116,48 @@ jobs:
130116
name: Python-Installer
131117
path: dist/*Setup*.exe
132118

119+
sign-application:
120+
name: Sign application
121+
needs: [build-application]
122+
runs-on:
123+
group: ansys-internal
124+
labels: [self-hosted, Windows, signtool]
125+
steps:
126+
- name: Checkout the SignTool
127+
uses: actions/checkout@v3
128+
with:
129+
repository: pyansys/signtool-ansys-apps
130+
token: ${{ secrets.SIGNTOOL_ACCESS_TOKEN }}
131+
132+
- uses: actions/download-artifact@v3
133+
with:
134+
name: Python-Installer
135+
path: signtool/installer
136+
137+
- name: List current structure
138+
run: ls -R
139+
140+
- name: Sign application
141+
working-directory: signtool
142+
run: |
143+
$filename = (get-ChildItem installer -recurse | where {$_.name -like "*Setup*"}).Name
144+
$jobname = $filename -replace ".{4}$"
145+
dotnet signclient.dll sign `
146+
-r ansyssigning@ansys.com `
147+
-s '${{ secrets.SIGNTOOL_PWD }}' `
148+
-c AppSettings.json `
149+
-n $jobname `
150+
-i installer/$filename
151+
152+
- uses: actions/upload-artifact@v3
153+
with:
154+
name: Python-Installer
155+
path: signtool/installer/*Setup*.exe
156+
133157
release:
134158
name: Release application
135159
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
136-
needs: [build-application]
160+
needs: [sign-application]
137161
runs-on: ubuntu-latest
138162
steps:
139163
- uses: actions/download-artifact@v3

uninstall.nsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ Section "Uninstall"
1111

1212
; Remove the installed files
1313
Delete "$INSTDIR\*.*"
14-
RMDir "$INSTDIR"
14+
RMDir /r /REBOOTOK "$INSTDIR"
1515

1616
; Remove the registry keys
1717
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
1818

1919
; Remove the start menu shortcut and directory
2020
Delete "$SMPROGRAMS\Ansys Python Manager\Ansys Python Manager.lnk"
21-
RMDir "$SMPROGRAMS\Ansys Python Manager"
21+
RMDir /r /REBOOTOK "$SMPROGRAMS\Ansys Python Manager"
2222

2323
; Display the uninstallation complete message
2424
MessageBox MB_OK|MB_ICONINFORMATION "${PRODUCT_NAME} ${PRODUCT_VERSION} has been successfully uninstalled."

0 commit comments

Comments
 (0)