Skip to content

Commit

Permalink
Installers...
Browse files Browse the repository at this point in the history
  • Loading branch information
jdunkerley committed Sep 27, 2017
1 parent 4b0bb1e commit e8a1864
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 4 deletions.
45 changes: 45 additions & 0 deletions Install Win7.bat
@@ -0,0 +1,45 @@
@echo off

>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

if '%errorlevel%' NEQ '0' (
if '%1' NEQ 'ELEV' (
echo Requesting administrative privileges...
goto UACPrompt
) else (
exit /B -1
)
) else (
goto gotAdmin
)

:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "ELEV", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B

:gotAdmin
pushd %~dp0

FOR %%A IN (*.xml *.dll) DO (echo.>%%A:Zone.Identifier)

FOR /F "usebackq tokens=2,* skip=2" %%L IN (
`reg query "HKLM\SOFTWARE\WOW6432Node\SRC\Alteryx" /v InstallDir64`
) DO SET alteryxPath=%%M

IF "%alteryxPath%" NEQ "" (
xcopy /Y *.xml "%alteryxPath%\RuntimeData\FormulaAddIn"
xcopy /Y *.dll "%alteryxPath%\RuntimeData\FormulaAddIn"
)

FOR /F "usebackq tokens=2,* skip=2" %%L IN (
`reg query "HKCU\SOFTWARE\SRC\Alteryx" /v InstallDir64`
) DO SET alteryxPath=%%M

IF "%alteryxPath%" NEQ "" (
xcopy /Y *.xml "%alteryxPath%\RuntimeData\FormulaAddIn"
xcopy /Y *.dll "%alteryxPath%\RuntimeData\FormulaAddIn"
)

popd
3 changes: 2 additions & 1 deletion Install.bat
@@ -1,2 +1,3 @@
@echo off
powershell "Start-Process -FilePath powershell.exe -ArgumentList "%~dp0\Installer.ps1" -verb RunAs -Wait"
powershell "gci . -Recurse | Unblock-File"
powershell "Start-Process -FilePath powershell.exe -ArgumentList '%~fs0\..\Installer.ps1' -verb RunAs -Wait"
3 changes: 3 additions & 0 deletions Installer.ps1
Expand Up @@ -25,6 +25,9 @@ if ($bins.Count -eq 0) {
}

$files = Get-ChildItem "$root\*.xml"
if ($files -is [System.IO.FileSystemInfo]) {
$files = @($files)
}
if ($mode.ToUpper() -eq "DEBUG") { $files += Get-ChildItem "$root\x64\Debug\*.dll" }
if ($mode.ToUpper() -eq "RELEASE") { $files += Get-ChildItem "$root\x64\Release\*.dll" }
if ($mode.ToUpper() -eq "ROOT") { $files += Get-ChildItem "$root\*.dll" }
Expand Down
55 changes: 55 additions & 0 deletions Uninstall Win7.bat
@@ -0,0 +1,55 @@
@echo off

>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

if '%errorlevel%' NEQ '0' (
if '%1' NEQ 'ELEV' (
echo Requesting administrative privileges...
goto UACPrompt
) else (
exit /B -1
)
) else (
goto gotAdmin
)

:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "ELEV", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B

:gotAdmin
pushd %~dp0

FOR %%A IN (*.xml *.dll) DO (echo.>%%A:Zone.Identifier)

FOR /F "usebackq tokens=2,* skip=2" %%L IN (
`reg query "HKLM\SOFTWARE\WOW6432Node\SRC\Alteryx" /v InstallDir64`
) DO SET alteryxPath=%%M

IF "%alteryxPath%" NEQ "" (
del /F "%alteryxPath%\RuntimeData\FormulaAddIn\Random.xml"
del /F "%alteryxPath%\RuntimeData\FormulaAddIn\MathUtils.xml"
del /F "%alteryxPath%\RuntimeData\FormulaAddIn\MiscUtils.xml"
del /F "%alteryxPath%\RuntimeData\FormulaAddIn\StringUtils.xml"
del /F "%alteryxPath%\RuntimeData\FormulaAddIn\DateUtils.xml"
del /F "%alteryxPath%\RuntimeData\FormulaAddIn\JDFormulaAddIn.dll"
del /F "%alteryxPath%\RuntimeData\FormulaAddIn\AlteryxAbacus.dll"
)

FOR /F "usebackq tokens=2,* skip=2" %%L IN (
`reg query "HKCU\SOFTWARE\SRC\Alteryx" /v InstallDir64`
) DO SET alteryxPath=%%M

IF "%alteryxPath%" NEQ "" (
del /F "%alteryxPath%\RuntimeData\FormulaAddIn\Random.xml"
del /F "%alteryxPath%\RuntimeData\FormulaAddIn\MathUtils.xml"
del /F "%alteryxPath%\RuntimeData\FormulaAddIn\MiscUtils.xml"
del /F "%alteryxPath%\RuntimeData\FormulaAddIn\StringUtils.xml"
del /F "%alteryxPath%\RuntimeData\FormulaAddIn\DateUtils.xml"
del /F "%alteryxPath%\RuntimeData\FormulaAddIn\JDFormulaAddIn.dll"
del /F "%alteryxPath%\RuntimeData\FormulaAddIn\AlteryxAbacus.dll"
)

popd
3 changes: 2 additions & 1 deletion Uninstall.bat
@@ -1,2 +1,3 @@
@echo off
powershell "Start-Process -FilePath powershell.exe -ArgumentList "%~dp0\Uninstaller.ps1" -verb RunAs -Wait"
powershell "gci . -Recurse | Unblock-File"
powershell "Start-Process -FilePath powershell.exe -ArgumentList '%~fs0\..\Uninstaller.ps1' -verb RunAs -Wait"
4 changes: 2 additions & 2 deletions Uninstaller.ps1
Expand Up @@ -3,13 +3,13 @@ $ErrorActionPreference = "Stop"

Write-Host "Finding Alteryx Admin Install Location..."
$reg = Get-ItemProperty HKLM:\SOFTWARE\WOW6432Node\SRC\Alteryx -ErrorAction SilentlyContinue
if ($reg -ne $null) {
if ($reg -ne $null -and $reg.InstallDir64 -ne $null) {
$bins += $reg.InstallDir64
}

Write-Host "Finding Alteryx User Install Location..."
$reg = Get-ItemProperty HKCU:\SOFTWARE\SRC\Alteryx -ErrorAction SilentlyContinue
if ($reg -ne $null) {
if ($reg -ne $null -and $reg.InstallDir64 -ne $null) {
$bins += $reg.InstallDir64
}

Expand Down

0 comments on commit e8a1864

Please sign in to comment.