Skip to content

Commit

Permalink
renamed msiSquirrel to msq, adjusted e2 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bitdisaster committed May 14, 2020
1 parent e24459d commit 0007b54
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 26 deletions.
8 changes: 2 additions & 6 deletions e2e/src/e2e-auto-launch.ts
Expand Up @@ -41,11 +41,6 @@ describe('MSI auto-launch', () => {

testConfigs.forEach((testConfig) => {
describe((`arch:${testConfig.arch}`), () => {
after(() => {
// even if we failed, we still wanna leave behind a clean state for the next test
fs.rmdirSync(msiPaths123beta.appRootFolder, { recursive: true });
});

const msiOptions = {
...autoLaunchMsiOptions,
...testConfig
Expand Down Expand Up @@ -99,7 +94,8 @@ describe('MSI auto-launch', () => {

it(`uninstalls (${testConfig.arch})`, async () => {
await uninstall(msiPath);
expect(await checkInstall(msiOptions.name)).not.ok();
expect(await checkInstall(`${msiOptions.name} (Machine)`)).not.ok();
expect(await checkInstall(`${msiOptions.name} (Machine - MSI)`)).not.ok();
expect(fs.pathExistsSync(msiPaths123beta.appRootFolder)).not.ok();
expect(fs.pathExistsSync(msiPaths123beta.startMenuShortcut)).not.ok();
expect(fs.pathExistsSync(msiPaths123beta.desktopShortcut)).not.ok();
Expand Down
11 changes: 4 additions & 7 deletions e2e/src/e2e-auto-updater.ts
Expand Up @@ -80,11 +80,6 @@ describe('MSI auto-updating', () => {

installConfigs.forEach((config) => {
describe((`userGroup:${config.effectiveUserGroup}`), () => {
after(() => {
// even if we failed, we still wanna leave behind a clean state for the next test
fs.rmdirSync(msiPaths123beta.appRootFolder, { recursive: true });
});

it(`installs (userGroup: ${config.effectiveUserGroup})`, async () => {
await install(msiPath, 2, config.userGroup);
const version = getWindowsCompliantVersion(msiOptions.version);
Expand Down Expand Up @@ -135,7 +130,7 @@ describe('MSI auto-updating', () => {
regValues.forEach(async (value) => {
it(`has uninstall registry key has value: ${value.name} (${testConfig.arch})`, async () => {
const installInfo = fs.readJSONSync(path.join(msiPaths123beta.appRootFolder, '.installInfo.json'));
const regKey = `${msiPaths123beta.registryUninstallKey}\\{${installInfo.productCode}}.msiSquirrel`;
const regKey = `${msiPaths123beta.registryUninstallKey}\\{${installInfo.productCode}}.msq`;
const regValue = await getRegistryKeyValue(regKey, value.name);
expect(regValue).to.be(value.value);
});
Expand Down Expand Up @@ -170,7 +165,9 @@ describe('MSI auto-updating', () => {

it(`uninstalls (userGroup: ${config.effectiveUserGroup})`, async () => {
await uninstall(msiPath);
expect(await checkInstall(msiOptions.name)).not.ok();
expect(await checkInstall(`${msiOptions.name} (Machine)`)).not.ok();
expect(await checkInstall(`${msiOptions.name} (Machine - MSI)`)).not.ok();
console.log(msiPaths123beta.appRootFolder);
expect(fs.pathExistsSync(msiPaths123beta.appRootFolder)).not.ok();
expect(fs.pathExistsSync(msiPaths123beta.startMenuShortcut)).not.ok();
expect(fs.pathExistsSync(msiPaths123beta.desktopShortcut)).not.ok();
Expand Down
7 changes: 2 additions & 5 deletions e2e/src/e2e-msi.ts
Expand Up @@ -157,13 +157,10 @@ describe('Electron WIX MSI', () => {
});

describe(`Uninstalling ${getTestConfigString()}`, () => {
after(() => {
// even if we failed, we still wanna leave behind a clean state for the next test
fs.rmdirSync(paths124.appRootFolder, { recursive: true });
});
it('uninstalls', async () => {
await uninstall(msiPath);
expect(await checkInstall(msiOptions.name)).not.ok();
expect(await checkInstall(`${msiOptions.name} (Machine)`)).not.ok();
expect(await checkInstall(`${msiOptions.name} (Machine - MSI)`)).not.ok();
expect(fs.pathExistsSync(paths124.appRootFolder)).not.ok();
expect(fs.pathExistsSync(paths124.startMenuShortcut)).not.ok();
expect(fs.pathExistsSync(paths124.desktopShortcut)).not.ok();
Expand Down
8 changes: 3 additions & 5 deletions e2e/src/e2e-per-user.ts
Expand Up @@ -65,10 +65,6 @@ describe('MSI perUser install', () => {
installConfigs.forEach((installConfig) => {
describe((`installMode:${installConfig.installMode !== undefined ?
installConfig.installMode : 'default' }`), () => {
after(() => {
// even if we failed, we still wanna leave behind a clean state for the next test
fs.rmdirSync(msiPaths123beta.appRootFolder, { recursive: true });
});
let autoLaunchRegistryKeyValue = '';
const msiPaths123beta = getInstallPaths(msiOptions, installConfig.effectiveMode);

Expand Down Expand Up @@ -116,7 +112,9 @@ describe('MSI perUser install', () => {

it(`uninstalls (${testConfig.arch})`, async () => {
await uninstall(msiPath);
expect(await checkInstall(msiOptions.name)).not.ok();
const nameSuffix = installConfig.effectiveMode === 'perUser' ? 'User' : 'Machine';
expect(await checkInstall(`${msiOptions.name} (${nameSuffix})`)).not.ok();
expect(await checkInstall(`${msiOptions.name} (${nameSuffix} - MSI)`)).not.ok();
expect(fs.pathExistsSync(msiPaths123beta.appRootFolder)).not.ok();
expect(fs.pathExistsSync(msiPaths123beta.startMenuShortcut)).not.ok();
expect(fs.pathExistsSync(msiPaths123beta.desktopShortcut)).not.ok();
Expand Down
Binary file modified harness/app/msq.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion src/creator.ts
Expand Up @@ -620,7 +620,7 @@ export class MSICreator {

private getRegistryKeys(): Array<Registry> {
const registry = new Array<Registry>();
const uninstallKey = 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{{{ProductCode}}}.msiSquirrel';
const uninstallKey = 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{{{ProductCode}}}.msq';
const productRegKey = 'SOFTWARE\\{{Manufacturer}}\\{{ApplicationShortName}}';

// On install we need to keep track of our install folder.
Expand Down
4 changes: 2 additions & 2 deletions static/wix.xml
Expand Up @@ -49,13 +49,13 @@
PurgeOnUninstall action. Since this package can be installed perUser or perMachine,
we have to look in both places. First successful search wins. -->
<Property Id="INSTALLPATH">
<RegistrySearch Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{{{ProductCode}}}.msiSquirrel"
<RegistrySearch Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{{{ProductCode}}}.msq"
Root="HKCU"
Type="raw"
Id="INSTALLPATH_REGSEARCH_HKCU"
Name="InstallPath"
Win64="{{Win64YesNo}}"/>
<RegistrySearch Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{{{ProductCode}}}.msiSquirrel"
<RegistrySearch Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{{{ProductCode}}}.msq"
Root="HKLM"
Type="raw"
Id="INSTALLPATH_REGSEARCH_HKLM"
Expand Down
Binary file modified vendor/msq.exe
Binary file not shown.

0 comments on commit 0007b54

Please sign in to comment.